$46 GRAYBYTE WORDPRESS FILE MANAGER $41

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/test2.proid.vn/my custom code/

HOME
Current File : /home/bqrcodec/test2.proid.vn/my custom code//handle-download-url-button.js
<script type="text/javascript">
jQuery(document).ready(function($) {
    // Listener is on the div with class "export-user-proid-urls-button"
    $(document).on('click', '.export-user-proid-urls-button', function(e) {
        e.preventDefault();

        var $clickedWidgetDiv = $(this); // This is the main div of the button widget
        var $linkElement = $clickedWidgetDiv.find('a.elementor-button'); // Find the <a> tag within the widget
        var userId;

        if ($linkElement.length > 0) {
            userId = $linkElement.attr('id'); // Get the ID from the <a> tag
            console.log("Found <a> tag with ID (User ID):", userId);
        } else {
            // This case should ideally not happen if the button HTML structure is consistent
            console.error("Could not find the <a> tag with class .elementor-button inside the clicked widget.");
            alert('Error: Button internal structure not found. Please contact support.');
            return;
        }

        // Validate if the extracted ID is a usable number
        if (!userId || isNaN(parseInt(userId))) {
            alert('Error: User ID found on link ("' + userId + '") is not a valid number. Please check button configuration and console log.');
            console.log('Clicked Widget (div) HTML:', $clickedWidgetDiv[0].outerHTML);
            if($linkElement.length > 0) {
                console.log('Link Element (a) HTML:', $linkElement[0].outerHTML);
            }
            return;
        }
        
        userId = parseInt(userId); // Convert to integer

        // Check if global AJAX variables are defined
        if (typeof meProIDExport === 'undefined' || typeof meProIDExport.ajax_url === 'undefined' || typeof meProIDExport.nonce === 'undefined') {
            alert('Error: AJAX configuration variables (meProIDExport) not found. Check functions.php.');
            return;
        }

        // Create and submit the form for download
        var form = $('<form></form>');
        form.attr('method', 'POST');
        form.attr('action', meProIDExport.ajax_url);

        var actionInput = $('<input></input>');
        actionInput.attr('type', 'hidden');
        actionInput.attr('name', 'action');
        actionInput.attr('value', 'me_proid_export_user_urls_action'); // Matches PHP hook
        form.append(actionInput);

        var userIdInput = $('<input></input>');
        userIdInput.attr('type', 'hidden');
        userIdInput.attr('name', 'user_id');
        userIdInput.attr('value', userId);
        form.append(userIdInput);

        var nonceInput = $('<input></input>');
        nonceInput.attr('type', 'hidden');
        nonceInput.attr('name', 'security_nonce'); // Matches PHP check_ajax_referer
        nonceInput.attr('value', meProIDExport.nonce);
        form.append(nonceInput);

        $(document.body).append(form);
        form.submit();
        form.remove();
    });
});
</script>

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
19 Mar 2026 10.15 AM
bqrcodec / nobody
0755
handle-download-url-button.js
2.867 KB
19 Mar 2026 8.44 AM
bqrcodec / bqrcodec
0644
save-contact-button-noti.js
7.871 KB
19 Mar 2026 8.44 AM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF