• 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

TOS agreement when guest-uploading

nsfwupload

Chevereto Member
@whatsin I actually have this implemented on my website and it's a very straight forward modification to the anywhere_upload.php file.

Simply use JSON to check that a checkbox is selected before the Upload button becomes clickable

nsfw_tos_agree_1.jpgnsfw_tos_agree_2.jpg.
 
@whatsin I actually have this implemented on my website and it's a very straight forward modification to the anywhere_upload.php file.

Simply use JSON to check that a checkbox is selected before the Upload button becomes clickable

Would you like to share your modification(s) with the community?
 
OPEN FILE /app/themes/PeaFowl/ snippets/anywhere_upload.php

FIND:

Code:
                        </select>
                    </div>
                    <?php
                        } // categories?
                    ?>

AFTER ADD:

Code:
                                        <!-- START AGREE TO TOS TO UPLOAD -->
                                        
                    <?php
                        if (CHV\getSetting('theme_nsfw_upload_checkbox') && !CHV\getSetting('enable_consent_screen')) {
                            ?>
                    <div class="margin-10"><span rel="tooltip" data-tiptip="top" title="<?php _se('Mark this if the upload is not family safe'); ?>"><input type="checkbox" name="upload-nsfw" id="upload-nsfw" class="margin-right-5" value="1"><label for="upload-nsfw"><?php _se('Not family safe upload'); ?></label></span></div>
                    <?php
                        }
                    ?>
                    
                                <div class="margin-10" checkbox-label>
                                    <label for="upload-accept-tos">
                                        <input type="checkbox" required name="upload-accept-tos" id="upload-accept-tos">
                                        <span><?php _se('I agree to the %terms_link and %privacy_link', ['%terms_link' => '<a '.get_page_tos()['link_attr'].' target="_blank"> '._s('Terms of Service').'</a>', '%privacy_link' => '<a '.get_page_privacy()['link_attr'].' target="_blank">'._s('Privacy Policy').'</a>']); ?></span>
                                    </label>

                    <button id="button" class="btn btn-big green" data-action="upload" data-public="<?php _se('Upload'); ?>" data-private="<?php _se('Private upload'); ?>"><?php echo is_forced_private_mode() ? _s('Private upload') : _s('Upload'); ?></button></span>

                </div>                               
    
                                    <!-- END AGREE TO TOS TO UPLOAD -->

AT THE VERY BOTTOM OF THE FILE ADD:

Code:
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function() {
  // Disable ToS
  function unblock() {
    $("#tos-checker").css("display", "none");
  }

  // Enable blocker
  function block() {
    $("#tos-checker").css("display", "block");
  }

  // Monitor the ToS checkbox
  $('body').on('click', '#upload-accept-tos', function() {
    if( $(this).prop("checked") ) {
        unblock();
    } else {
        block();
    }
  });
 
  // Has ToS been accepted?
  $('#tos-checker').on('click', function() {
    alert('You must agree to our Terms of Service to upload.');
  });
});
</script>

Working example : nsfwupload.com
 
It does not work for me.
The guest can upload without accepting.

browser: Firefox 102
Chevereto: : 3.20.18
 
Back
Top