Announcement

Collapse
No announcement yet.

[Workaround] Allow flash for Profile picture edit

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Workaround] Allow flash for Profile picture edit

    So as of right now. The rewards1 Profile picture uploader is broken. It requires flash, which is now disabled in most browsers.



    Google chrome users (PC) This can be temporally fixed using the steps below.
    1. Click the i Icon (or similar)[see image below.]
    2. Find the flash option, and set it to ALLOW.
    3. Click off of the menu and you should be prompted with a reload button. Click that
    4. Try clicking the edit button again and you should see the browse field again. If not, you may have to try the above steps again.





    Last edited by rmsoft1; 03-18-2018, 03:47 PM.
    Project: Classified

  • #2
    Originally posted by rmsoft1 View Post
    enable flash for pic edit
    heck flash, use this (you need tampermonkey or greasemonkey for the following link)
    https://greasyfork.org/en/scripts/39...e-pic-uploader

    or alternatively hit ctrl+shift+j in chrome and paste this in on your profile:
    Code:
    $('#image_uploader').html('<canvas id="drop" style="background: #eee; border: 2px solid #ddd;" width="500" height="500"></canvas><input id="dropsubmit" type="submit" />');
    var userId = $('[name="user_id"]').val();
    var $dropZone = $('#drop');
    var dropZone = $dropZone[0];
    var ctx = dropZone.getContext("2d");
    
    function dataURItoBlob(dataURI) {
        var byteString = atob(dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var ab = new ArrayBuffer(byteString.length);
        var ia = new Uint8Array(ab);
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }
        var blob = new Blob([ab], {
            type: mimeString
        });
        return blob;
    }
    
    function dragEnter(ev) {
        ev.preventDefault();
        $dropZone.css('border-color', 'orange');
    }
    
    function dragOver(ev) {
        ev.preventDefault();
    }
    
    function dragLeave(ev) {
        ev.preventDefault();
        $dropZone.css('border-color', '');
    }
    
    function drop(ev) {
        ev.preventDefault();
        var files = ev.dataTransfer.files;
        var reader = new FileReader();
        var file = files[0];
        reader.onload = function() {
            var img = new Image();
            img.onload = function() {
                var scale = 1;
                if (img.width > img.height) {
                    scale = 500 / img.width;
                } else {
                    scale = 500 / img.height;
                }
                dropZone.width = img.width * scale;
                dropZone.height = img.height * scale;
                ctx.fillStyle = "#fff";
                ctx.fillRect(0, 0, dropZone.width, dropZone.height);
                ctx.drawImage(img, 0, 0, dropZone.width, dropZone.height);
            };
            img.src = reader.result;
        };
        reader.onloadend = function() {
        };
        if (file.type.match('image.*')) {
            reader.readAsDataURL(file);
        } else {
            alert('Please upload an image');
        }
        $dropZone.css('border-color', '');
    }
    ctx.fillStyle = "#666";
    ctx.font = "bold 16px Arial";
    ctx.textBaseline = 'middle';
    ctx.textAlign = 'center';
    ctx.fillText("Drag and drop an image here", 250, 250);
    dropZone.addEventListener('dragenter', dragEnter, false);
    dropZone.addEventListener('dragover', dragOver, false);
    dropZone.addEventListener('dragleave', dragLeave, false);
    dropZone.addEventListener('drop', drop, false);
    $('#dropsubmit').click(() => {
    
        var blob = dataURItoBlob(dropZone.toDataURL("image/jpeg"));
        var formData = new FormData();
        formData.append('user_prize_id', '');
        formData.append('pic_type', 'profile_avatar');
        formData.append('user_id', userId);
        formData.append('Filename', userId + '.jpg');
        formData.append('Filedata', blob, userId + '.jpg');
        formData.append('Upload', 'Submit Query');
    
        var xhr = new XMLHttpRequest();
        xhr.onload = () => {
            location.reload(true);
        };
        xhr.open('post', '/image_upload_handler.php');
        xhr.send(formData);
    });
    then go to the edit menu thing and scroll down to the uploader
    Last edited by LiMiTx; 03-20-2018, 11:17 PM.
    Originally posted by jollyhersfa
    Now it is not the Communists but our own government that seeks our slavery, spies on us and gives us less and less while taking more and more. The biggest hollow rabbit of all to me is the American people. We are lazy, scared and apathetic.

    WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEE IM PICKLE DIIIIICCCCKKK!!!!!!!!!!!!! WUBALUBADUBDUBBBBBBBBBBBBBBBBBB

    i <3 systematicgal3k2!! i really hope we get married some day
    sigpic

    Comment


    • #3
      i dont understand flashplayer still works jsut fine on firefox and chrome for me? they removed all other similar addons tho
      best picture ever! https://www.youtube.com/watch?v=ntl96KXPsbo

      All hail the best staff "dotti" fear for her wrath!!!

      Comment


      • #4
        Originally posted by jomberiini View Post
        i dont understand flashplayer still works jsut fine on firefox and chrome for me? they removed all other similar addons tho
        what versions do you have?

        On all even semi-recent-ish browsers, flash is disabled by default everywhere. It usually prompts you to allow flash on a case by case basis. For some reason v4's flash uploader doesn't bring up the allow prompt in chrome though.
        Originally posted by jollyhersfa
        Now it is not the Communists but our own government that seeks our slavery, spies on us and gives us less and less while taking more and more. The biggest hollow rabbit of all to me is the American people. We are lazy, scared and apathetic.

        WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEE IM PICKLE DIIIIICCCCKKK!!!!!!!!!!!!! WUBALUBADUBDUBBBBBBBBBBBBBBBBBB

        i <3 systematicgal3k2!! i really hope we get married some day
        sigpic

        Comment


        • #5
          Ye

          This is a good guide 10/10 rate it

          Comment


          • #6
            Nice guides! It works.


            CLUB IHT

            [DRAGON SLAYER] (Legend): randomguy2K3, lakesbrian, awesomeness2800, Twobroz, Xan1, Keatonpotaoes, LightShades

            Comment

            Working...
            X