Forum Replies Created

Viewing 14 posts - 1 through 14 (of 14 total)
  • in reply to: Support for anonymous backers in crowdfunding layout #92399
    m0majeed
    Member
    Post count: 18

    Hey Ed,

    This wasn’t added to the most recent update did it?

    in reply to: Support for anonymous backers in crowdfunding layout #90557
    m0majeed
    Member
    Post count: 18

    Nice one! 😉 Can’t wait to try it out.

    in reply to: Users cannot edit their campaign (crowdfunding) #90315
    m0majeed
    Member
    Post count: 18

    Thanks man, trying it now. 🙂

    in reply to: Users cannot edit their campaign (crowdfunding) #90046
    m0majeed
    Member
    Post count: 18

    @Ed, I am testing from the front end.

    With the CF plugin there is shortcode_profile which is a front end shortcode, users can view and submit projects from there.

    in reply to: Users cannot edit their campaign (crowdfunding) #89687
    m0majeed
    Member
    Post count: 18
    This reply has been marked as private.
    in reply to: Users cannot edit their campaign (crowdfunding) #89686
    m0majeed
    Member
    Post count: 18

    They cannot save and preview either:

    Fatal error: Call to undefined function wp_generate_attachment_metadata() in /home/igiveonl/public_html/wp-content/plugins/appthemer-crowdfunding/includes/shortcode-submit.php on line 581

    in reply to: Support for anonymous backers in crowdfunding layout #89681
    m0majeed
    Member
    Post count: 18

    Thanks man, let me know if you need it tested.

    in reply to: Insert campaign comment in backers (crowdfunding) #89680
    m0majeed
    Member
    Post count: 18

    Hey Ed,

    The comment is sorted, thanks.

    You could add this to the next update but bare in mind that this is for a custom function and isn’t a part of the core EDD or CF plugins.

    🙂

    in reply to: Insert campaign comment in backers (crowdfunding) #89623
    m0majeed
    Member
    Post count: 18
    This reply has been marked as private.
    in reply to: Insert campaign comment in backers (crowdfunding) #89622
    m0majeed
    Member
    Post count: 18
    This reply has been marked as private.
    in reply to: Support for anonymous backers in crowdfunding layout #89621
    m0majeed
    Member
    Post count: 18

    In the crowdfunding plugin there is this, if you look at the end there is the option for anon backers:

    /**
     * Track number of purchases for each pledge amount.
     *
     * @since Astoundify Crowdfunding 0.9
     *
     * @param int $payment the ID number of the payment
     * @param array $payment_data The payment data for the cart
     * @return void
     */
    function atcf_log_pledge_limit( $payment_id, $new_status, $old_status ) {
    	global $edd_logs;
    
    	// Make sure that payments are only completed once
    	if ( $old_status != 'pending' )
    		return;
    
    	// Make sure the payment completion is only processed when new status is complete
    	if ( in_array( $new_status, array( 'refunded', 'failed', 'revoked' ) ) )
    		return;
    
    	if ( edd_is_test_mode() && ! apply_filters( 'edd_log_test_payment_stats', false ) )
    		return;
    
    	atcf_update_backer_count( $payment_id, 'increase' );
    }
    add_action( 'edd_update_payment_status', 'atcf_log_pledge_limit', 100, 3 );
    
    function atcf_update_backer_count( $payment_id, $direction ) {
    	$payment_data = edd_get_payment_meta( $payment_id );
    	$downloads    = maybe_unserialize( $payment_data[ 'downloads' ] );
    
    	if ( ! is_array( $downloads ) )
    		return;
    
    	foreach ( $downloads as $download ) {
    		$variable_pricing = edd_get_variable_prices( $download[ 'id' ] );
    
    		foreach ( $variable_pricing as $key => $value ) {
    			$what = $download[ 'options' ][ 'price_id' ];
    
    			if ( ! isset ( $variable_pricing[ $what ][ 'bought' ] ) )
    				$variable_pricing[ $what ][ 'bought' ] = 0;
    
    			$current = $variable_pricing[ $what ][ 'bought' ];
    
    			if ( $key == $what ) {
    				if ( 'increase' == $direction ) {
    					$variable_pricing[ $what ][ 'bought' ] = $current + 1;
    				} else {
    					$variable_pricing[ $what ][ 'bought' ] = $current - 1;
    				}
    			}
    		}
    
    		update_post_meta( $download[ 'id' ], 'edd_variable_prices', $variable_pricing );
    	}
    }
    
    function atcf_edd_purchase_form_user_info() {
    	if ( ! atcf_theme_supports( 'anonymous-backers' ) )
    		return;
    ?>
    	<p id="edd-anon-wrap">
    		<label class="edd-label" for="edd-anon">
    			<input class="edd-input" type="checkbox" name="edd_anon" id="edd-anon" style="vertical-align: middle;" />
    			<?php _e( 'Remain anonymous? Hide name on donors list?', 'atcf' ); ?>
    		</label>
    	</p>
    <?php
    }
    add_action( 'edd_purchase_form_after_user_info', 'atcf_edd_purchase_form_user_info' );
    
    /**
     * Save if the user wants to remain anonymous.
     *
     * This is up to the theme to actually honor.
     *
     * @since Astoundify Crowdfunding 1.2
     *
     * @param arrray $payment_meta Array of payment meta about to be saved
     * @return array $payment_meta An updated array of payment meta
     */
    function atcf_anon_save_meta( $payment_meta ) {
    	$payment_meta[ 'anonymous' ] = isset ( $_POST[ 'edd_anon' ] ) ? 1 : 0;
    
    	return $payment_meta;
    }
    add_filter( 'edd_payment_meta', 'atcf_anon_save_meta' );
    
    in reply to: Support for anonymous backers in crowdfunding layout #89620
    m0majeed
    Member
    Post count: 18
    This reply has been marked as private.
    in reply to: Insert campaign comment in backers (crowdfunding) #89613
    m0majeed
    Member
    Post count: 18
    This reply has been marked as private.
    in reply to: Insert campaign comment in backers (crowdfunding) #89611
    m0majeed
    Member
    Post count: 18
    This reply has been marked as private.
Viewing 14 posts - 1 through 14 (of 14 total)