WordPress.org

Ready to get started?Download WordPress

Forums

Electric Studio Download Counter
Feedback for no downloads yet (1 post)

  1. nerdjgua
    Member
    Posted 1 year ago #

    I needed a function that shows (No downloads yet) on the shortcode for files that don't have downloads yet.

    So, I made a quick hack on plugin, on line 582:

    function download_count_shortcode( $atts ) {
            extract( shortcode_atts( array( 'link' => '' ), $atts ) );
            $d = new ESDC_Data;
            if( $link != '' ) {
                $_c = $d->get_data( $link );
    			if ($_c[ 0 ][ 'count' ]){
    				return  '('.$_c[ 0 ][ 'count' ].' downloads)';
    			} else {
    				return '(No downloads yet)';
    			}
    
            } else {
                return 'No count available';
            }
        }

    This solution works great to give feedback to users. Also adds some text to count number (that shows alone on the page).

    http://wordpress.org/extend/plugins/electric-studio-download-counter/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags