• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

Account needed before download images

Shah

Chevereto Member
Hello All,

How can i force unregistered user to create an account before download images. The popup will appear when they click download button. I know this requires a code work, thats why i am asking. Any one help me? Thanks
Untitled.png
 
Add data-login-needed attribute to the download button. It works for any clickable element.
 
Can you show me how to implement for this as you are the chevereto GURU, you know what's code/attribute needed for this & where to post. I mean you can tell me copy code from "xyz" file & replace with "xyz" file.

Thanks
 
Last edited:
Ok Thanks! could you please tell me where to put this attribute? in which file i have to make changes.

Cheers
 
1. "app/themes/Peafowl/views/image.php"
2. Type "Ctrl+F" in your keyboard and enter "download=", you should find this:
HTML:
download=
3. Change it to this:
HTML:
data-login-needed download=
4. Click "Save" then upload that to your FTP.

I didn't wanted to put you the code right away because I believe that is good for you to learn basics of HTML if you run a website. Don't take me wrong, you don't need to be an expert to run a website, but I think that anyone with a website should be familiar with the basics of HTML.

Cheers.
 
Hello @Rodolfo Thanks it's working perfectly 🙂 i know the basics of html but don't know in depth, actually there are lot of files just wanted to know the path of files to get find easily.
 
1. "app/themes/Peafowl/views/image.php"
2. Type "Ctrl+F" in your keyboard and enter "download=", you should find this:
HTML:
download=
3. Change it to this:
HTML:
data-login-needed download=
4. Click "Save" then upload that to your FTP.

I didn't wanted to put you the code right away because I believe that is good for you to learn basics of HTML if you run a website. Don't take me wrong, you don't need to be an expert to run a website, but I think that anyone with a website should be familiar with the basics of HTML.

Cheers.

very usefull thanks!
 
I've applied this code to the specified file, but no luck. I still seem to be able to download files. Does this fix still apply? I know the post was originally in 2015.

Has this worked for anyone on the latest version of Chevereto?
 
That's very strange. I got it to work on the list view (I added code above the 'Like' button for downloading) no problem. But I can't seem to get it to work for the 'download' button on the standalone picture page (eg.. domain.com/image/Y1fu8). Here is my file, if anyone else has any suggestions or workarounds, please let me know.

1537587350950.png

PHP:
        <div class="header-content-right">
            <?php if(CHV\getSetting('theme_download_button')) { ?>
            <a href="<?php echo get_image()['url']; ?>" data-login-needed download="<?php echo get_image()['filename']; ?>" class="btn btn-download default" rel="tooltip" title="<?php echo get_image()["width"] . ' x ' . get_image()["height"] . ' - ' . strtoupper(get_image()["extension"]) . ' ' . get_image()["size_formatted"]; ?>"><span class="btn-icon icon-download"></span></a>
            <?php } ?>
            <?php
                if(CHV\getSetting('enable_likes')) {
            ?>
            <a class="btn-like" data-type="image" data-id="<?php echo get_image()['id_encoded']; ?>" data-liked="<?php echo (int)get_image()['liked']; ?>" data-action="like">
                <span class="btn btn-liked blue" rel="tooltip" title="<?php _se("You like this"); ?>"><span class="btn-icon icon-heart3"></span><span class="btn-text phone-hide"><?php _se('Liked'); ?></span></span>
                <span class="btn btn-unliked blue outline"><span class="btn-icon icon-heart4"></span><span class="btn-text phone-hide"><?php _se('Like'); ?></span></span>
            </a>
            <?php
                }
            ?>
            <?php if(CHV\getSetting('theme_show_social_share')) { ?>
            <a class="btn red" data-modal="simple" data-target="modal-share"><span class="btn-icon icon-share"></span><span class="btn-text phone-hide"><?php _se('Share'); ?></span></a>
            <?php } ?>
        </div>
 
Which web browser are you using for testing this? The download attribute isn't standard yet, not all the web browsers implement it.
 
Make sure you have it like this
"data-login-needed download="

And not like this

" data-login-needed download="

So remove the space infront of data and behind " so more likely between these and see if it works then.
 
Which web browser are you using for testing this? The download attribute isn't standard yet, not all the web browsers implement it.

I'm using Chrome 69. It does work on my browser because it works for me on my /explore/recent page. (pastepic.xyz)

It just doesn't work on single image page pastepic.xyz/image/Y1HTC

I'm using the same code, same everything. Works one place, doesn't work in the other. Very strange.
 
Make sure you have it like this
"data-login-needed download="

And not like this

" data-login-needed download="

So remove the space infront of data and behind " so more likely between these and see if it works then.

I appreciate that but it didn't work.
 
How is that possible if I'm editing the image.php file? There is only one image.php file in that path...
Make sure that you don't have similar image.php inside the override folder if you do then you gota edit that one instead of original one
 
Back
Top