Import original plugin

parent 50a3914e
This diff is collapsed.
This theme or plugin is comprised of two parts.
(1) the PHP code and integrated HTML are licensed under the General Public
License (GPL). You will find a copy of the GPL in the same directory as this
text file.
(2) All other parts, but not limited to the CSS code, images, and design are
licensed according to the license purchased from Envato.
Read more about licensing here: http://themeforest.net/licenses
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*!
* Bootstrap v2.3.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.pagination {
margin: 20px 0;
}
.pagination ul {
display: inline-block;
*display: inline;
margin-bottom: 0;
margin-left: 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
*zoom: 1;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pagination ul > li {
display: inline;
}
.pagination ul > li > a,
.pagination ul > li > span {
float: left;
padding: 4px 12px;
line-height: 20px;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
border-left-width: 0;
}
.pagination ul > li > a:hover,
.pagination ul > li > a:focus,
.pagination ul > .active > a,
.pagination ul > .active > span {
background-color: #f5f5f5;
}
.pagination ul > .active > a,
.pagination ul > .active > span {
color: #999999;
cursor: default;
}
.pagination ul > .disabled > span,
.pagination ul > .disabled > a,
.pagination ul > .disabled > a:hover,
.pagination ul > .disabled > a:focus {
color: #999999;
cursor: default;
background-color: transparent;
}
.pagination ul > li:first-child > a,
.pagination ul > li:first-child > span {
border-left-width: 1px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
-moz-border-radius-topleft: 4px;
}
.pagination ul > li:last-child > a,
.pagination ul > li:last-child > span {
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
}
.pagination-centered {
text-align: center;
}
.pagination-right {
text-align: right;
}
.pagination-large ul > li > a,
.pagination-large ul > li > span {
padding: 11px 19px;
font-size: 17.5px;
}
.pagination-large ul > li:first-child > a,
.pagination-large ul > li:first-child > span {
-webkit-border-bottom-left-radius: 6px;
border-bottom-left-radius: 6px;
-webkit-border-top-left-radius: 6px;
border-top-left-radius: 6px;
-moz-border-radius-bottomleft: 6px;
-moz-border-radius-topleft: 6px;
}
.pagination-large ul > li:last-child > a,
.pagination-large ul > li:last-child > span {
-webkit-border-top-right-radius: 6px;
border-top-right-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
border-bottom-right-radius: 6px;
-moz-border-radius-topright: 6px;
-moz-border-radius-bottomright: 6px;
}
.pagination-mini ul > li:first-child > a,
.pagination-small ul > li:first-child > a,
.pagination-mini ul > li:first-child > span,
.pagination-small ul > li:first-child > span {
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-left-radius: 3px;
-moz-border-radius-bottomleft: 3px;
-moz-border-radius-topleft: 3px;
}
.pagination-mini ul > li:last-child > a,
.pagination-small ul > li:last-child > a,
.pagination-mini ul > li:last-child > span,
.pagination-small ul > li:last-child > span {
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-right-radius: 3px;
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
}
.pagination-small ul > li > a,
.pagination-small ul > li > span {
padding: 2px 10px;
font-size: 11.9px;
}
.pagination-mini ul > li > a,
.pagination-mini ul > li > span {
padding: 0 6px;
font-size: 10.5px;
}
.pager {
margin: 20px 0;
text-align: center;
list-style: none;
*zoom: 1;
}
.pager:before,
.pager:after {
display: table;
line-height: 0;
content: "";
}
.pager:after {
clear: both;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #f5f5f5;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #999999;
cursor: default;
background-color: #fff;
}
This diff is collapsed.
@font-face {
font-family: 'footable';
src: url('fonts/footable.eot');
src: url('fonts/footable.eot?#iefix') format('embedded-opentype'), url('fonts/footable.woff') format('woff'), url('fonts/footable.ttf') format('truetype'), url('fonts/footable.svg#footable') format('svg');
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
@font-face {
font-family: 'footable';
src: url('fonts/footable.svg#footable') format('svg');
font-weight: normal;
font-style: normal;
}
}
.footable {
width: 100%;
/** SORTING **/
/** PAGINATION **/
}
.footable.breakpoint > tbody > tr.footable-detail-show > td {
border-bottom: none;
}
.footable.breakpoint > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e001";
}
.footable.breakpoint > tbody > tr:hover:not(.footable-row-detail) {
cursor: pointer;
}
.footable.breakpoint > tbody > tr > td.footable-cell-detail {
background: #eee;
border-top: none;
}
.footable.breakpoint > tbody > tr > td > span.footable-toggle {
display: inline-block;
font-family: 'footable';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
padding-right: 5px;
font-size: 14px;
color: #888888;
}
.footable.breakpoint > tbody > tr > td > span.footable-toggle:before {
content: "\e000";
}
.footable.breakpoint.toggle-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e005";
}
.footable.breakpoint.toggle-circle > tbody > tr > td > span.footable-toggle:before {
content: "\e004";
}
.footable.breakpoint.toggle-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e003";
}
.footable.breakpoint.toggle-circle-filled > tbody > tr > td > span.footable-toggle:before {
content: "\e002";
}
.footable.breakpoint.toggle-square > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e007";
}
.footable.breakpoint.toggle-square > tbody > tr > td > span.footable-toggle:before {
content: "\e006";
}
.footable.breakpoint.toggle-square-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e009";
}
.footable.breakpoint.toggle-square-filled > tbody > tr > td > span.footable-toggle:before {
content: "\e008";
}
.footable.breakpoint.toggle-arrow > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e00f";
}
.footable.breakpoint.toggle-arrow > tbody > tr > td > span.footable-toggle:before {
content: "\e011";
}
.footable.breakpoint.toggle-arrow-small > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e013";
}
.footable.breakpoint.toggle-arrow-small > tbody > tr > td > span.footable-toggle:before {
content: "\e015";
}
.footable.breakpoint.toggle-arrow-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e01b";
}
.footable.breakpoint.toggle-arrow-circle > tbody > tr > td > span.footable-toggle:before {
content: "\e01d";
}
.footable.breakpoint.toggle-arrow-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e00b";
}
.footable.breakpoint.toggle-arrow-circle-filled > tbody > tr > td > span.footable-toggle:before {
content: "\e00d";
}
.footable.breakpoint.toggle-arrow-tiny > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e01f";
}
.footable.breakpoint.toggle-arrow-tiny > tbody > tr > td > span.footable-toggle:before {
content: "\e021";
}
.footable.breakpoint.toggle-arrow-alt > tbody > tr.footable-detail-show > td > span.footable-toggle:before {
content: "\e017";
}
.footable.breakpoint.toggle-arrow-alt > tbody > tr > td > span.footable-toggle:before {
content: "\e019";
}
.footable.breakpoint.toggle-medium > tbody > tr > td > span.footable-toggle {
font-size: 18px;
}
.footable.breakpoint.toggle-large > tbody > tr > td > span.footable-toggle {
font-size: 24px;
}
.footable > thead > tr > th {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
}
.footable > thead > tr > th.footable-sortable:hover {
cursor: pointer;
}
.footable > thead > tr > th.footable-sorted > span.footable-sort-indicator:before {
content: "\e013";
}
.footable > thead > tr > th.footable-sorted-desc > span.footable-sort-indicator:before {
content: "\e012";
}
.footable > thead > tr > th > span.footable-sort-indicator {
display: inline-block;
font-family: 'footable';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
padding-left: 5px;
}
.footable > thead > tr > th > span.footable-sort-indicator:before {
content: "\e022";
}
.footable > tfoot .pagination {
margin: 0;
}
.footable.no-paging .hide-if-no-paging {
display: none;
}
.footable-row-detail-inner {
display: table;
}
.footable-row-detail-row {
display: table-row;
line-height: 1.5em;
}
.footable-row-detail-group {
display: block;
line-height: 2em;
font-size: 1.2em;
font-weight: bold;
}
.footable-row-detail-name {
display: table-cell;
font-weight: bold;
padding-right: 0.5em;
}
.footable-row-detail-value {
display: table-cell;
}
.footable-odd {
background-color: #f7f7f7;
}
This diff is collapsed.
.pledgemaincontainer {
color:green;
}
.pledgetracker {
height: 10px;
border-radius: 5px;
position: relative;
background: #f3efe6;
overflow: hidden;
}
.rightsidepledge {
float:right;
}
.pledgetracker span {
display: block;
height: 100%;
}
.currentpledgegoal {
background-color: #c66799;
-webkit-animation: currentpledgebar 2s ease-in-out;
-webkit-animation-fill-mode:both;
-moz-animation: currentpledgebar 2s ease-in-out;
-moz-animation-fill-mode:both;
}
@-webkit-keyframes currentpledgebar {
0% { width: 0; }
100% { width: 100%; }
}
@-moz-keyframes currentpledgebar {
0% { width: 0; }
100% { width: 100%; }
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
global $woocommerce;
global $unsubscribe_link2;
if (get_user_meta($author, 'gf_email_unsub_value', true) != 'yes') {
$post = '';
$author = get_post_field('post_author', isset($post->ID));
//the_author_meta('user_nicename', $author);
//$mainname = the_author_meta('user_nicename', $author);
$tos = $fieldarray;
$subject = do_shortcode(get_option('approved_mail_subject'));
//$subject = var_dump($post);
$message = do_shortcode(get_option('approved_mail_message'));
$create_wpnonce = wp_create_nonce('gf_unsubscribe_' . $author);
$link_for_unsubscribe = esc_url_raw(add_query_arg(array('userid' => $author, 'unsub' => 'yes', 'nonce' => $create_wpnonce), site_url()));
$updated_link_unsubscribe = CrowdFunding::add_hyperlink_for_unsub_link($link_for_unsubscribe);
$unsubscribe_link1 = get_option('gf_unsubscribe_link_for_email');
$unsubscribe_link2 = str_replace('{gfunsubscribelink}',$updated_link_unsubscribe,$unsubscribe_link1);
add_filter('woocommerce_email_footer_text', 'unsubscribe_footer_link');
ob_start();
wc_get_template('emails/email-header.php', array('email_heading' => $subject));
echo $message;
wc_get_template('emails/email-footer.php');
$woo_temp_msg = ob_get_clean();
//$author = get_post_field('post_author', $campaign_id);
//the_author_meta('user_nicename', $author);
//$mainname = the_author_meta('user_nicename', $author);
//$mainemail = the_author_meta('user_email', $author);
$mainnames = get_option('woocommerce_email_from_name');
$mainemails = get_option('woocommerce_email_from_address');
// To send HTML mail, the Content-type header must be set
$headerss = 'MIME-Version: 1.0' . "\r\n";
$headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headerss .= 'From:' . $mainnames . ' <' . $mainemails . '>' . "\r\n";
// Mail it
if ((float) $woocommerce->version <= (float) ('2.2.0')) {
$mail = wp_mail($tos, $subject, $woo_temp_msg, $headerss);
} else {
$mailer = WC()->mailer();
$mailer->send($tos, $subject, $woo_temp_msg, '', '');
}
}
<?php
global $unsubscribe_link2;
if (get_user_meta($user_ID, 'gf_email_unsub_value', true) != 'yes') {
$tos = $fieldarray;
$subject = do_shortcode(get_option('campaign_submission_email_subject'));
$message = do_shortcode(get_option('campaign_submission_email_message'));
$create_wpnonce = wp_create_nonce('gf_unsubscribe_' . $user_ID);
$link_for_unsubscribe = esc_url_raw(add_query_arg(array('userid' => $user_ID, 'unsub' => 'yes', 'nonce' => $create_wpnonce), site_url()));
$updated_link_unsubscribe = CrowdFunding::add_hyperlink_for_unsub_link($link_for_unsubscribe);
$unsubscribe_link1 = get_option('gf_unsubscribe_link_for_email');
$unsubscribe_link2 = str_replace('{gfunsubscribelink}',$updated_link_unsubscribe,$unsubscribe_link1);
add_filter('woocommerce_email_footer_text', 'unsubscribe_footer_link');
ob_start();
wc_get_template('emails/email-header.php', array('email_heading' => $subject));
echo $message;
wc_get_template('emails/email-footer.php');
$woo_temp_msg = ob_get_clean();
//$author = get_post_field('post_author', $campaign_id);
//the_author_meta('user_nicename', $author);
//$mainname = the_author_meta('user_nicename', $author);
//$mainemail = the_author_meta('user_email', $author);
$mainnames = get_option('woocommerce_email_from_name');
$mainemails = get_option('woocommerce_email_from_address');
// To send HTML mail, the Content-type header must be set
$headerss = 'MIME-Version: 1.0' . "\r\n";
$headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headerss .= 'From:' . $mainnames . ' <' . $mainemails . '>' . "\r\n";
// Mail it
if ((float) $woocommerce->version <= (float) ('2.2.0')) {
$mail = wp_mail($tos, $subject, $woo_temp_msg, $headerss);
} else {
$mailer = WC()->mailer();
$mailer->send($tos, $subject, $woo_temp_msg, '', '');
}
}
?>
This diff is collapsed.
<?php
class CampaignApprovedEmail {
public static function campaign_approved_email() {
global $post_id;
global $woocommerce;
$posttype = get_post_type($post_id);
if ($posttype == 'product') {
$oldstatusmessage = get_post_status($post_id);
if ($oldstatusmessage == 'draft') {
$oldstatus = update_post_meta($post_id, '_cf_old_status', $oldstatusmessage);
}
if ($oldstatusmessage == 'publish') {
$newstatus = update_post_meta($post_id, '_cf_new_status', $oldstatusmessage);
}
}
}
public static function campaign_status_email_check() {
global $post_id;
global $woocommerce;
$oldstatus = get_post_meta($post_id, '_cf_old_status', true);
$newstatus = get_post_meta($post_id, '_cf_new_status', true);
$checkvalue = get_post_meta($post_id, '_crowdfundingcheckboxvalue', true);
if ($checkvalue == 'yes') {
if (($oldstatus == 'draft') && ($newstatus == 'publish')) {
// echo "Status Changed from Draft to Published";
$getdate = date("m/d/Y");
$frompublishdate = update_post_meta($post_id, '_crowdfundingfromdatepicker', $getdate);
$campaign_duration = get_post_meta($post_id, '_crowdfundingcampaignduration', true);
$todatenew = date('m/d/Y', strtotime($frompublishdate . ' + ' . $campaign_duration . ' days'));
update_post_meta($post_id, '_crowdfundingtodatepicker', $todatenew);
if (get_option('cf_enable_mail_for_campaign_approved') == 'yes') {
if (get_option('cf_send_email_to_campaign_creator_on_approved') == 'yes') {
$author = get_post_field('post_author', $post_id);
$creatoremail = get_the_author_meta('user_email', $author);
}
if (get_option('cf_send_email_to_site_admin_on_approved') == 'yes') {
$adminemail = get_option('admin_email');
}
$newarray = array($creatoremail, $adminemail);
if (get_option('cf_send_email_to_others_on_approved') == 'yes') {
$text = trim(get_option('cf_send_email_to_others_mail_on_approved'));
$textAr = explode("\n", $text);
$textAr = array_filter($textAr, 'trim'); // remove any extra \r characters left behind
foreach ($textAr as $line) {
$newarray[] = $line;
}
}
foreach ($newarray as $fieldarray) {
if (!is_null($fieldarray) || $fieldarray != '') {
// $msg = "First line of text\nSecond line of text";
// $msg = wordwrap($msg, 70);
// mail($fieldarray, "My subject", $msg);
include'approved_campaign_email.php';
}
}
}
update_post_meta($post_id, '_cf_old_status', 'publish');
}
}
}
}
add_action('admin_head', array('CampaignApprovedEmail', 'campaign_approved_email'));
add_action('admin_head', array('CampaignApprovedEmail', 'campaign_status_email_check'));
new CampaignApprovedEmail();
?>
This diff is collapsed.
This diff is collapsed.
<?php
class FPCrowdFundingContribution {
public static function cf_replace_add_cart($add_to_cart_text) {
global $post;
// echo $post->ID;
$postmeta = get_post_meta($post->ID, '_crowdfundingcheckboxvalue', true);
$checkstockstatus = get_post_meta($post->ID, '_stock_status', true);
if ($postmeta == 'yes') {
if ($checkstockstatus == 'instock') {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.add_to_cart_button').each(function() {
var newvar = jQuery(this).attr('data-product_id');
//alert(newvar);
jQuery(this).addClass('newone' + newvar);
});
});
</script>
<style type="text/css">
.newone<?php echo $post->ID; ?> {
display:none !important;
}
</style>
<?php
} else {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.button').each(function() {
var newvar = jQuery(this).attr('data-product_id');
//alert(newvar);
if (!jQuery(this).hasClass('newone' + newvar)) {
jQuery(this).addClass('outofstock' + newvar);
}
});
});
</script>
<style type="text/css">
.outofstock<?php echo $post->ID; ?> {
display:none !important;
}
</style>
<?php
}
$add_to_cart_text = get_option('cf_add_to_cart_label');
return $add_to_cart_text;
}
return $add_to_cart_text;
}
public static function cf_hide_qty_in_product() {
global $post;
$postmeta = get_post_meta($post->ID, '_crowdfundingcheckboxvalue', true);
if ($postmeta == 'yes') {
echo '<script>jQuery(document).ready(function(){jQuery(".qty").css("display","none");});</script>';
}
}
}
add_filter('woocommerce_product_single_add_to_cart_text', array('FPCrowdFundingContribution', 'cf_replace_add_cart'));
add_filter('add_to_cart_text', array('FPCrowdFundingContribution', 'cf_replace_add_cart'));
add_filter('woocommerce_product_add_to_cart_text', array('FPCrowdFundingContribution', 'cf_replace_add_cart'));
add_action('wp_head', array('FPCrowdFundingContribution', 'cf_hide_qty_in_product'));
?>
\ No newline at end of file
<?php
class CampaignContributionEmail {
public static function campaign_contribution_email() {
global $post;
global $woocommerce;
foreach (get_posts('post_type=product&numberposts=-1&post_status=publish') as $products) {
//echo "Google";
$checkvalue = get_post_meta($products->ID, '_crowdfundingcheckboxvalue', true);
if ($checkvalue == 'yes') {
$getfundertotal = get_post_meta($products->ID, '_update_total_funders', true);
add_post_meta($products->ID, '_update_new_total_funders', $getfundertotal);
//delete_post_meta($products->ID, '_update_new_total_funders');
$newfundertotal = get_post_meta($products->ID, '_update_new_total_funders', true);
$checknewpost = add_post_meta($products->ID, '_newfundtotal', 'false');
// echo "Get it into the condition" . "<br>";
echo $getfundertotal . "<br>";
if ($getfundertotal > $newfundertotal) {
echo "Fund has Been Raised";
if (get_option('cf_enable_mail_for_campaign_for_campaign_order') == 'yes') {
if (get_option('cf_send_email_to_campaign_creator_on_campaign_order') == 'yes') {
$author = get_post_field('post_author', $products->ID);
$creatoremail = get_the_author_meta('user_email', $author);
}
if (get_option('cf_send_email_to_site_admin_on_campaign_order') == 'yes') {
$adminemail = get_option('admin_email');
}
$newarray = array($creatoremail, $adminemail);
if (get_option('cf_send_email_to_others_on_campaign_order') == 'yes') {
$text = trim(get_option('cf_send_email_to_others_mail_on_campaign_order'));
$textAr = explode("\n", $text);
$textAr = array_filter($textAr, 'trim'); // remove any extra \r characters left behind
foreach ($textAr as $line) {
$newarray[] = $line;
}
}
foreach ($newarray as $fieldarray) {
if (!is_null($fieldarray) || $fieldarray != '') {
include 'crowdfunding_order_emails.php';
}
}
}
update_post_meta($products->ID, '_update_new_total_funders', $getfundertotal);
}
if ($checknewpost == 'false') {
if ($getfundertotal == '1') {
if (get_option('cf_enable_mail_for_campaign_for_campaign_order') == 'yes') {
if (get_option('cf_send_email_to_campaign_creator_on_campaign_order') == 'yes') {
$author = get_post_field('post_author', $products->ID);
$creatoremail = get_the_author_meta('user_email', $author);
}
if (get_option('cf_send_email_to_site_admin_on_campaign_order') == 'yes') {
$adminemail = get_option('admin_email');
}
$newarray = array($creatoremail, $adminemail);
if (get_option('cf_send_email_to_others_on_campaign_order') == 'yes') {
$text = trim(get_option('cf_send_email_to_others_mail_on_campaign_order'));
$textAr = explode("\n", $text);
$textAr = array_filter($textAr, 'trim'); // remove any extra \r characters left behind
foreach ($textAr as $line) {
$newarray[] = $line;
}
}
foreach ($newarray as $fieldarray) {
if (!is_null($fieldarray) || $fieldarray != '') {
include 'crowdfunding_order_emails.php';
}
}
}
delete_post_meta($products->ID, '_newfundtotal');
add_post_meta($products->ID, '_newfundtotal', 'true');
}
}
}
}
}
}
//add_action('woocommerce_order_status_completed', array('CampaignContributionEmail', 'newwoocommerce'), 10, 1);
add_action('admin_head', array('CampaignContributionEmail', 'campaign_contribution_email'));
add_action('wp_head', array('CampaignContributionEmail', 'campaign_contribution_email'));
new CampaignContributionEmail();
//add_action('woocommerce_order_status_completed', 'my_function');
/*
* Do something after WooCommerce sets an order on completed
*/
function my_function($order_id) {
// order object (optional but handy)
global $order_id;
var_dump($order_id);
$order = new WC_Order($order_id);
var_dump($order);
// do some stuff here
}
?>
<?php
class CampaignDeletedEmail {
public static function campaign_deleted_email() {
global $post;
global $woocommerce;
foreach (get_posts('post_type=product&numberposts=-1&post_status=trash,draft,publish') as $products) {
$posttype = get_post_type($products->ID);
if ($posttype == 'product') {
$products->ID;
$oldstatusmessage = get_post_status($products->ID);
if ($oldstatusmessage == 'publish') {
$oldstatus = update_post_meta($products->ID, '_cf_old_status', $oldstatusmessage);
}
if ($oldstatusmessage == 'trash') {
$newstatus = update_post_meta($products->ID, '_cf_new_status', $oldstatusmessage);
}
}
}
}
public static function campaign_deleted_status_email_check() {
global $post;
global $woocommerce;
if (isset($_GET['ids'])) {
if ($_GET['ids']) {
$splitids = explode(',', $_GET['ids']);
$count = count($splitids);
for ($i = 0; $i < $count; $i++) {
$checkvalue = get_post_meta($splitids[$i], '_crowdfundingcheckboxvalue', true);
if ($checkvalue == 'yes') {
$oldstatus = get_post_meta($splitids[$i], '_cf_old_status', true);
$newstatus = get_post_meta($splitids[$i], '_cf_new_status', true);
//echo $splitids[$i] . "<br>";
if ((($oldstatus == 'publish') && ($newstatus == 'trash'))) {
if (get_option('cf_enable_mail_for_campaign_deleted') == 'yes') {
if (get_option('cf_send_email_to_campaign_creator_on_deleted') == 'yes') {
$author = get_post_field('post_author', $splitids[$i]);
$creatoremail = get_the_author_meta('user_email', $author);
}
if (get_option('cf_send_email_to_site_admin_on_deleted') == 'yes') {
$adminemail = get_option('admin_email');
}
$newarray = array($creatoremail, $adminemail);
if (get_option('cf_send_email_to_others_on_deleted') == 'yes') {
$text = trim(get_option('cf_send_email_to_others_mail_on_deleted'));
$textAr = explode("\n", $text);
$textAr = array_filter($textAr, 'trim'); // remove any extra \r characters left behind
foreach ($textAr as $line) {
$newarray[] = $line;
}
}
foreach ($newarray as $fieldarray) {
if (!is_null($fieldarray) || $fieldarray != '') {
include'deleted_campaign_email.php';
}
}
}
// echo "Unfortunately Your Campaign Has Been Deleted";
$newstatus = update_post_meta($splitids[$i], '_cf_old_status', 'trash');
}
}
}
}
}
}
}
add_action('admin_head', array('CampaignDeletedEmail', 'campaign_deleted_email'));
add_action('admin_head', array('CampaignDeletedEmail', 'campaign_deleted_status_email_check'));
new CampaignDeletedEmail();
?>
This diff is collapsed.
<?php
class CFErrorMessage {
public static function crowdfunding_admin_error_tab($settings_tabs) {
$settings_tabs['crowdfunding_errormessage'] = __('Error Message', 'galaxyfunder');
return $settings_tabs;
}
public static function crowdfunding_error_admin_options() {
return apply_filters('woocommerce_crowdfunding_error_settings', array(
array(
'name' => __('Error Message Settings', 'galaxyfunder'),
'type' => 'title',
// 'desc' => 'Shortcode Available (Supported for Simple Products)<br> <pre> [cf_min_price] => Minimum Contribution </pre><pre> [cf_max_price] => Maximum Contribution </pre>',
'id' => '_cf_product_error_settings'
),
array(
'name' => __('Minimum Contribution Error Message', 'galaxyfunder'),
'desc' => __('Please Enter Minimum Contribution Error Message', 'galaxyfunder'),
'tip' => '',
'id' => 'cf_min_price_error_msg',
'css' => 'min-width:550px;',
'std' => 'Please Enter Minimum Contribution',
'type' => 'text',
'newids' => 'cf_min_price_error_msg',
'desc_tip' => true,
),
array(
'name' => __('Maximum Contribution Error Message', 'galaxyfunder'),
'desc' => __('Please Enter Maximum Contribution Error Message', 'galaxyfunder'),
'tip' => '',
'css' => 'min-width:550px;',
'id' => 'cf_max_price_error_msg',
'std' => 'Contribution should not be more than Maximum Contribution',
'type' => 'text',
'newids' => 'cf_max_price_error_msg',
'desc_tip' => true,
),
array(
'name' => __('Input Contribution Error Message', 'galaxyfunder'),
'desc' => __('Please Enter your Input Error Message', 'galaxyfunder'),
'tip' => '',
'id' => 'cf_input_price_error_message',
'css' => 'min-width:550px;',
'std' => 'Please Enter Only Numbers',
'type' => 'text',
'newids' => 'cf_input_price_error_message',
'desc_tip' => true,
),
array(
'name' => __('Display Error Message on', 'galaxyfunder'),
'desc' => __('This Controls where the Error Message should be Displayed', 'galaxyfunder'),
'id' => 'display_select_box_crowdfunding',
'css' => 'min-width:150px;',
'std' => 'bottom', // WooCommerce < 2.0
'default' => 'bottom', // WooCommerce >= 2.0
'newids' => 'bottom',
'type' => 'select',
'options' => array(
'top' => __('Above Contribution Text Box', 'galaxyfunder'),
'bottom' => __('Below Contribution Text Box', 'galaxyfunder'),
),
),
array(
'name' => __('Perk Error Message', 'galaxyfunder'),
'desc' => __('This Controls where the Error Message of Perk Should be Displayed', 'galaxyfunder'),
'tip' => '',
'id' => 'cf_perk_error_message',
'css' => 'min-width:550px;',
'std' => 'Contribution Amount Should be equal or greater than Perk Value', 'galaxyfunder',
'type' => 'text',
'newids' => 'cf_perk_error_message',
'desc_tip' => true,
),
array('type' => 'sectionend', 'id' => '_cf_product_error_settings'),
));
}
public static function crowdfunding_process_error_admin_settings() {
woocommerce_admin_fields(CFErrorMessage::crowdfunding_error_admin_options());
}
public static function crowdfunding_process_error_update_settings() {
woocommerce_update_options(CFErrorMessage::crowdfunding_error_admin_options());
}
public static function crowdfunding_error_default_settings() {
global $woocommerce;
foreach (CFErrorMessage::crowdfunding_error_admin_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_error_reset_values() {
global $woocommerce;
if (isset($_POST['reset'])) {
foreach (CFErrorMessage::crowdfunding_error_admin_options() as $setting)
if (isset($setting['newids']) && ($setting['std'])) {
delete_option($setting['newids']);
add_option($setting['newids'], $setting['std']);
}
}
}
}
new CFShopPageAdmin();
add_action('woocommerce_update_options_crowdfunding_errormessage', array('CFErrorMessage', 'crowdfunding_process_error_update_settings'));
add_action('init', array('CFErrorMessage', 'crowdfunding_error_default_settings'));
add_action('woocommerce_cf_settings_tabs_crowdfunding_errormessage', array('CFErrorMessage', 'crowdfunding_process_error_admin_settings'));
add_filter('woocommerce_cf_settings_tabs_array', array('CFErrorMessage', 'crowdfunding_admin_error_tab'), 1500);
add_action('admin_init', array('CFErrorMessage', 'cf_error_reset_values'), 2);
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
class CFPerkInfoinOrder {
/* Construct the Function without Creating the Object */
public function __construct() {
add_action('add_meta_boxes', array($this, 'add_meta_box_for_order_table'));
}
public static function add_meta_box_for_order_table() {
add_meta_box(__('Perk Information', 'galaxyfunder'), __('Perk Information', 'galaxyfunder'), array('CFPerkInfoinOrder', 'list_perk_information_in_order_table'), 'shop_order', 'normal', 'low');
}
public static function list_perk_information_in_order_table() {
$orderid = $_GET['post'];
$perkclaimedvalue = false;
$createobject = new WC_Order($orderid);
?>
<table class="wp-list-table widefat fixed posts">
<thead>
<th>
<?php _e("Perk Name", 'galaxyfunder'); ?>
</th>
<th>
<?php _e("Perk Associated Product", 'galaxyfunder'); ?>
</th>
<th>
<?php _e("Perk Products", 'galaxyfunder'); ?>
</th>
</thead>
<tbody>
<?php
foreach ($createobject->get_items() as $value) {
$getperkname = get_post_meta($orderid, 'perkname' . $value['product_id'], true);
$getperkproduct = get_post_meta($orderid, 'perk_choosed_product' . $value['product_id'], true);
if ($getperkname != '') {
?>
<tr>
<td><?php echo $getperkname; ?></td>
<td><?php echo get_the_title($value['product_id']); ?></td>
<td><?php echo $getperkproduct != '' ? get_the_title($getperkproduct) : '---'; ?></td>
</tr>
<?php
$perkclaimedvalue = true;
}
}
if ($perkclaimedvalue != true) {
?>
<tr>
<td colspan="3"><?php _e("No Perks Associated for this Order", 'galaxyfunder'); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
}
new CFPerkInfoinOrder();
This diff is collapsed.
<?php
class CampaignRejectedEmail {
public static function campaign_rejected_email() {
global $post;
global $woocommerce;
foreach (get_posts('post_type=product&numberposts=-1&post_status=trash,draft,publish') as $products) {
$posttype = get_post_type($products->ID);
if ($posttype == 'product') {
$products->ID;
$oldstatusmessage = get_post_status($products->ID);
if ($oldstatusmessage == 'draft') {
$oldstatus = update_post_meta($products->ID, '_cf_old_status', $oldstatusmessage);
}
if ($oldstatusmessage == 'trash') {
$newstatus = update_post_meta($products->ID, '_cf_new_status', $oldstatusmessage);
}
}
}
}
public static function campaign_rejection_status_email_check() {
global $post;
global $woocommerce;
if (isset($_GET['ids'])) {
if ($_GET['ids']) {
$splitids = explode(',', $_GET['ids']);
$count = count($splitids);
for ($i = 0; $i < $count; $i++) {
$checkvalue = get_post_meta($splitids[$i], '_crowdfundingcheckboxvalue', true);
if ($checkvalue == 'yes') {
$oldstatus = get_post_meta($splitids[$i], '_cf_old_status', true);
$newstatus = get_post_meta($splitids[$i], '_cf_new_status', true);
if ((($oldstatus == 'draft') && ($newstatus == 'trash'))) {
if (get_option('cf_enable_mail_for_campaign_rejected') == 'yes') {
if (get_option('cf_send_email_to_campaign_creator_on_rejected') == 'yes') {
$author = get_post_field('post_author', $splitids[$i]);
//do_shortcode('[cf_site_campaign_name]');
//do_shortcode(get_option('rejected_mail_message'));
$creatoremail = get_the_author_meta('user_email', $author);
}
if (get_option('cf_send_email_to_site_admin_on_rejected') == 'yes') {
$adminemail = get_option('admin_email');
}
$newarray = array($creatoremail, $adminemail);
if (get_option('cf_send_email_to_others_on_rejected') == 'yes') {
$text = trim(get_option('cf_send_email_to_others_mail_on_rejected'));
$textAr = explode("\n", $text);
$textAr = array_filter($textAr, 'trim'); // remove any extra \r characters left behind
foreach ($textAr as $line) {
$newarray[] = $line;
}
}
foreach ($newarray as $fieldarray) {
if (!is_null($fieldarray) || $fieldarray != '') {
include'rejected_campaign_email.php';
}
}
}
$newstatus = update_post_meta($splitids[$i], '_cf_old_status', 'trash');
}
}
}
}
}
}
}
add_action('admin_head', array('CampaignRejectedEmail', 'campaign_rejected_email'));
add_action('admin_head', array('CampaignRejectedEmail', 'campaign_rejection_status_email_check'));
new CampaignRejectedEmail();
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
global $woocommerce;
global $unsubscribe_link2;
if (get_user_meta($author, 'gf_email_unsub_value', true) != 'yes') {
$author = get_post_field('post_author', $products->ID);
$tos = $fieldarray;
$subject = do_shortcode(get_option('campaign_completion_mail_subject'));
$message = do_shortcode(get_option('campaign_completion_mail_message'));
$create_wpnonce = wp_create_nonce('gf_unsubscribe_' . $author);
$link_for_unsubscribe = esc_url_raw(add_query_arg(array('userid' => $author, 'unsub' => 'yes', 'nonce' => $create_wpnonce), site_url()));;
$unsubscribe_link1 = get_option('gf_unsubscribe_link_for_email');
$updated_link_unsubscribe = CrowdFunding::add_hyperlink_for_unsub_link($link_for_unsubscribe);
$unsubscribe_link1 = get_option('gf_unsubscribe_link_for_email');
$unsubscribe_link2 = str_replace('{gfunsubscribelink}',$updated_link_unsubscribe,$unsubscribe_link1);
add_filter('woocommerce_email_footer_text', 'unsubscribe_footer_link');
ob_start();
wc_get_template('emails/email-header.php', array('email_heading' => $subject));
echo $message;
wc_get_template('emails/email-footer.php');
$woo_temp_msg = ob_get_clean();
$mainnames = get_option('woocommerce_email_from_name');
$mainemails = get_option('woocommerce_email_from_address');
// To send HTML mail, the Content-type header must be set
$headerss = 'MIME-Version: 1.0' . "\r\n";
$headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headerss .= 'From:' . $mainnames . ' <' . $mainemails . '>' . "\r\n";
// Mail it
if ((float) $woocommerce->version <= (float) ('2.2.0')) {
$mail = wp_mail($tos, $subject, $woo_temp_msg, $headerss);
} else {
$mailer = WC()->mailer();
$mailer->send($tos, $subject, $woo_temp_msg, '', '');
}
}
?>
This diff is collapsed.
This diff is collapsed.
<?php
global $woocommerce;
global $unsubscribe_link2;
if (get_user_meta($author, 'gf_email_unsub_value', true) != 'yes') {
$author = get_post_field('post_author', $product_id);
$tos = $fieldarray;
$subject = do_shortcode(get_option('contribution_mail_subject'));
$message = $message = do_shortcode(get_option('contribution_mail_message'));
$create_wpnonce = wp_create_nonce('gf_unsubscribe_' . $author);
$link_for_unsubscribe = esc_url_raw(add_query_arg(array('userid' => $author, 'unsub' => 'yes', 'nonce' => $create_wpnonce), site_url()));;
$unsubscribe_link1 = get_option('gf_unsubscribe_link_for_email');
$updated_link_unsubscribe = CrowdFunding::add_hyperlink_for_unsub_link($link_for_unsubscribe);
$unsubscribe_link1 = get_option('gf_unsubscribe_link_for_email');
$unsubscribe_link2 = str_replace('{gfunsubscribelink}',$updated_link_unsubscribe,$unsubscribe_link1);
add_filter('woocommerce_email_footer_text', 'unsubscribe_footer_link');
ob_start();
wc_get_template('emails/email-header.php', array('email_heading' => $subject));
echo $message;
wc_get_template('emails/email-footer.php');
$woo_temp_msg = ob_get_clean();
$mainnames = get_option('woocommerce_email_from_name');
$mainemails = get_option('woocommerce_email_from_address');
// To send HTML mail, the Content-type header must be set
$headerss = 'MIME-Version: 1.0' . "\r\n";
$headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headerss .= 'From:' . $mainnames . ' <' . $mainemails . '>' . "\r\n";
// Mail it
if ((float) $woocommerce->version <= (float) ('2.2.0')) {
$mail = wp_mail($tos, $subject, $woo_temp_msg, $headerss);
} else {
$mailer = WC()->mailer();
$mailer->send($tos, $subject, $woo_temp_msg, '', '');
}
}
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
jQuery(function() {
jQuery("#_crowdfundingfromdatepicker").datepicker({
changeMonth: true,
onClose: function(selectedDate) {
var maxDate = new Date(Date.parse(selectedDate));
maxDate.setDate(maxDate.getDate() + 1);
jQuery("#_crowdfundingtodatepicker").datepicker("option", "minDate", maxDate);
}
});
jQuery("#_crowdfundingtodatepicker").datepicker({
changeMonth: true,
onClose: function(selectedDate) {
jQuery("#_crowdfundingfromdatepicker").datepicker("option", "maxDate", selectedDate);
}
});
});
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment