Go Back   Forums > Support > Guides & Walkthroughs
New Posts
 
 
Thread Tools
Old 03-18-2018, 02:43 PM   #1
rmsoft1
Rank:
LEGEND
Trade: 12   0

 
 
Join Date: Mar 15, 2015
Location: Rewards1 API
Posts: 373
Default [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.




__________________
Project: RMSoftware.ModularBot 1.4.0

Last edited by rmsoft1; 03-18-2018 at 02:47 PM.
rmsoft1 is offline  
Old 03-18-2018, 07:19 PM   #2
LiMiTx
Rank:
LEGEND
Trade: 71   0

 
 
Join Date: May 20, 2014
Location: ye
Posts: 429
Send a message via ICQ to LiMiTx Send a message via AIM to LiMiTx Send a message via MSN to LiMiTx Send a message via Yahoo to LiMiTx Send a message via Skype™ to LiMiTx
Default

Quote:
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
__________________
Quote:
Originally Posted by jollyhersfa View Post
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

Last edited by LiMiTx; 03-20-2018 at 10:17 PM.
LiMiTx is offline  
Old 03-30-2018, 07:47 AM   #3
jomberiini
Rank:
VETERAN
Trade: 18   0

 
 
Join Date: Aug 6, 2012
Location: everywhere
Posts: 365
Default

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!!!
jomberiini is offline  
Old 03-30-2018, 04:44 PM   #4
LiMiTx
Rank:
LEGEND
Trade: 71   0

 
 
Join Date: May 20, 2014
Location: ye
Posts: 429
Send a message via ICQ to LiMiTx Send a message via AIM to LiMiTx Send a message via MSN to LiMiTx Send a message via Yahoo to LiMiTx Send a message via Skype™ to LiMiTx
Default

Quote:
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.
__________________
Quote:
Originally Posted by jollyhersfa View Post
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
LiMiTx is offline  
Old 04-29-2018, 10:28 PM   #5
thegreatone
Rank:
LEGEND
Trade: 39   0

 
 
Join Date: Feb 12, 2015
Posts: 182
Default Ye

This is a good guide 10/10 rate it
thegreatone is offline  
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump