• Resolved projecttoday

    (@projecttoday)


    Using Download Monitor, I get a count of the downloads, but the count of downloads shows on the site itself, visible to all users. Is there any way to suppress the count of downloads on the site while still being able to get the count? I have tried:

    [download id=”453″ template=”download”]
    [download id=”453″ template=”box”]
    [download id=”453″ template=”button”]
    [download id=”453″ template=”filename”]

    But they all show the count.

    If not, is there another plugin that will?

Viewing 9 replies - 1 through 9 (of 9 total)
  • paulovsky

    (@paulovsky)

    You will have to create your own template. This page tells you how to do it: https://www.download-monitor.com/kb/overriding-content-templates/

    For example, for the filename template, duplicate and copy to your theme folder the content-download-filename.php and delete this entire line:

    (<?php printf( _n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' ), $dlm_download->get_download_count() ) ?>)

    • This reply was modified 7 years ago by paulovsky.
    Thread Starter projecttoday

    (@projecttoday)

    Okay, if I actually succeed in creating this template, how would it work? So, I’ve got a link that does not show the downloads count. Where would I get the count?

    paulovsky

    (@paulovsky)

    Then your template will have to have a conditional.

    Instead of deleting the line that I mentioned, you can replace it with this:

    if ( is_user_logged_in() ) {
        printf( _n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' ), $dlm_download->get_download_count() );
    } else {
        //no soup for you!
     }

    please test it as I am not a developer.

    Thread Starter projecttoday

    (@projecttoday)

    Can you direct me to a working demo?

    paulovsky

    (@paulovsky)

    You can test it on your website. Follow the instructions above and it should work. If you are logged in, it will show a count of how many downloads. Logged out users won’t see it.

    Daniel981

    (@daniel981)

    Here is an example of a custom template I created that does not show the download count.

    <?php
    /**
     * Shows title with a PDF icon before
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    } // Exit if accessed directly
    
    /** @var DLM_Download $dlm_download */
    ?>
    <a class="download-link" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
    	printf( __( 'Version %s', 'download-monitor' ), $dlm_download->get_version()->get_version_number() );
    } ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
    	<img src="/img/pdf_icon.gif" alt="PDF Icon" /> <?php $dlm_download->the_title(); ?>
    </a>

    You could copy the above text and save the file as content-download-pdf.php and upload it to wp-content/plugins/download-monitor/templates/ If you didn’t want the PDF icon included, then you would modify the code as needed.

    Here is an example of how the links show: https://imgur.com/CKsCFOj

    Hello,

    Please note that when you customize our template, never add them to the plugin folder. When you update the plugin, the changes would be lost.

    To override our templates or to create custom templates, place those files inside your theme within a subfolder named “download-monitor”.

    I hope that answers your query. Let us know if you have any further questions.

    Thread Starter projecttoday

    (@projecttoday)

    Thanks to all who posted.

    Daniel981, when I click on the link I get a site where I see “+6 views” every time. I’m confused. Where do I see the download count?

    Daniel981

    (@daniel981)

    @projecttoday , that was a link to a screenshot of an example of how the links show up on my website. As Harish Chouhan mentioned, create a directory in your themes directory named “download-monitor” and upload a custom theme (like the one I gave the code to before) to the new directory just created. You can make your links look however you want, it’s just going to take a little tweaking until you get what you want.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove download count from site’ is closed to new replies.