Latest topics
» Recent Topic with Avatar problem
by Wolfuryo Today at 08:27

» Nicknames for @Mentions
by jucarese Today at 08:24

» FM Themes
by SLGray Yesterday at 21:48

» User - Made Creations
by SLGray Yesterday at 21:47

» Modify Category Tabs lead to a desired position and auto scroll click
by djblah Yesterday at 19:19

» [Bug] Missing username in Notifications
by Ape Yesterday at 17:44

» Dark Mode + Another Question
by Haggis Wed 16 Aug 2017, 18:11

» IconSkouliki
by skouliki Wed 16 Aug 2017, 14:52

» make the topic a color
by mr.blake214 Wed 16 Aug 2017, 12:06

» Forum text has changed to bold
by tillytiger99 Wed 16 Aug 2017, 05:02

» Request a Username Change
by mr.blake214 Wed 16 Aug 2017, 01:30

» Display a preview of the user profile on hover
by HoeGy48 Tue 15 Aug 2017, 16:51

» Hai Guys~
by mr.blake214 Tue 15 Aug 2017, 13:48

» Forumactif Messenger - Instant Message Application for Forumotion
by DDril Tue 15 Aug 2017, 10:25

» Donation Box
by Ange Tuteur Tue 15 Aug 2017, 09:59

Recent Tutorials
Who is online?
In total there are 7 users online :: 1 Registered, 0 Hidden and 6 Guests :: 1 Bot

snows

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

replace the default image uploader with imgur uploader

View previous topic View next topic Go down

avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Mon 29 Aug 2016, 03:36

this trick will allow you to replace the default image uploader button with imgur uploader button
the first step you need to go to
https://api.imgur.com/oauth2/addclient
and reggister to be a member if you are not a member yet if you already a member then goto the next step
create api to use imgur
like this image blow

when you upload an image it will show spining icon like this

after upload the image is done the image will be added instant

no to the Script part
in the JavaScript Manger
new
name : imgur uploader or what you like
place : in all pages to be able to use the button in new topic or reply pages
the content
Code:
;window['FormData'] && $(function(){$(function(){
   
      var imgur_client_id = 'your-imgur-id-here'; // you will get it via http://api.imgur.com/oauth2/addclient
   
      var current = 0, uploaded, xhrs, file_selector, button = $('.sceditor-button-servimg').off().click(function(){
        if(current) return finish();
        if(!file_selector) file_selector = $('<input type="file" multiple/ accept="image/*">').css({position:'absolute', top:-100}).appendTo('body').change(function (e) {
          var files = e.target.files, fd, len;
          uploaded = [], xhrs = [];
          for (var i = 0, len = files.length; i < len; i += 1) {
            if (files[i].type.indexOf('image/') && files[i].type !== 'application/pdf') continue;
            current++;
            fd = new FormData();
            fd.append('image', files[i]);
            (function(xhr){
              var num = i, xhr = jQuery.ajaxSettings.xhr();
              xhrs.push(xhr);
              xhr.open('POST', 'https://api.imgur.com/3/image');
              xhr.setRequestHeader('Authorization', 'Client-ID '+imgur_client_id);
              xhr.onreadystatechange = function () {
                if (xhr.readyState !== 4) return;
                current--;
                if (xhr.status === 200) {
                  var res = JSON.parse(xhr.responseText);
                  uploaded[num] = res.data.link;
                }
                if(!current) finish();
              };
              xhr.send(fd);
            })();
          }
          if(current) button.css({background:'url(http://i.imgur.com/EMsOJtZ.gif) no-repeat'});
        });
        file_selector.click();
        return false;
      }).children();
      var finish = function(){
        for(var i=0; i < xhrs.length; i++) {
            if(xhrs[i].readyState == 4) continue;
            xhrs[i].onreadystatechange = function(){};
            xhrs[i].abort();
        }
        for(var i=0; i < uploaded.length; i++) {
          if(uploaded[i] === undefined) continue;
          $('body').find('.sceditor-button-image').click().end().find('.sceditor-insertimage').find('#image').val(uploaded[i]).end().find('input.button').click();
          $('#text_editor_textarea').sceditor('instance').insertText('\n');
        }
        button.removeAttr('style');
        current = 0;
        file_selector.wrap('<form>').closest('form').get(0).reset();
        file_selector.unwrap();
        return false;
      };
    })});
dont forget your imgur ID
replace
your-imgur-id-here
in the 2nd line with your imgur ID that you did in the first of the topic
and save the Script
all done and have fun with the new fast uploading images and its also to imgur i think its the best image server till now
Party

Notice
Tutorial written and translated by @Michael_vx.
Credit for the script and original tutorial goes to Ea from the French Support forum.
avatar
SLGray
Valued Member
Title :
Owner of 2 Forums
Gender : Male
Age : 44
Posts : 2385
Points : 4596
Reputation : 282
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
Awards :
View all awards
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on Mon 29 Aug 2016, 17:41

Does this mean that images uploaded by members will go into your account? If yes, would this not use up the storage for one account?
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Mon 29 Aug 2016, 18:53

will yes
but i think imgur is a great image server
so i dont think we have to worry about that part of storage
avatar
Valoish
Graphic Designer
Title :
Gender : Female
Age : 20
Posts : 3621
Points : 4645
Reputation : 350
Location : NYC
Language : English, Russian, Hebrew
Browser : Browser : Opera Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://www.canvasforums.com https://twitter.com/https://twitter.com/Valoishx3

PostValoish on Mon 29 Aug 2016, 18:59

I was thinking about the whole storage thing as well.. 
I did some research and it seems like there aren't any bandwidth limits set for free imgur accounts anymore.
Short article can be found here
Imgur Blog post
So doing this should be okay..

--------

"I was afraid. And my own insecurity crushed him." - Youku x Boku SS
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Mon 29 Aug 2016, 19:14

thats looks a good news to me
we dont have to worry about limits
avatar
Valoish
Graphic Designer
Title :
Gender : Female
Age : 20
Posts : 3621
Points : 4645
Reputation : 350
Location : NYC
Language : English, Russian, Hebrew
Browser : Browser : Opera Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://www.canvasforums.com https://twitter.com/https://twitter.com/Valoishx3

PostValoish on Mon 29 Aug 2016, 19:27

@Michael_vx Considering testing this on my Forum.. But before I do, this is compatible with any version right? Not just phpBB3 or whatever else?

--------

"I was afraid. And my own insecurity crushed him." - Youku x Boku SS
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Mon 29 Aug 2016, 19:28

will
it should be for all versions since its to the Editor Smile
if there a problem please let me know
avatar
Valoish
Graphic Designer
Title :
Gender : Female
Age : 20
Posts : 3621
Points : 4645
Reputation : 350
Location : NYC
Language : English, Russian, Hebrew
Browser : Browser : Opera Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://www.canvasforums.com https://twitter.com/https://twitter.com/Valoishx3

PostValoish on Tue 30 Aug 2016, 13:30

Alrighty~ I'll try it out tonight and let you know if I run into any issues :B

--------

"I was afraid. And my own insecurity crushed him." - Youku x Boku SS
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9685
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 30 Aug 2016, 14:35

@Michael_vx Ooooh tested it and it works beautifully. loove


P.S.
You might want to give credit to the author of the script by adding a link to the tutorial at the end of your post. Wink
http://forum.forumactif.com/t381038-utiliser-imgur-comme-hebergeur-d-image

e.g. "Credit for the script goes to..", "Script by", etc..
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Tue 30 Aug 2016, 21:43

thank you for passing by my small simple woek of translation
by the waay about credits to the owner
if you want to add them i dont mind
your way in give the credits is better then my way Smile
im not good Enough in English
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9685
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 31 Aug 2016, 11:00

@Michael_vx sure no problem, I added a small notice to the end of your tutorial. Thumb right
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Wed 31 Aug 2016, 11:30

thank you for the tip
ill try keep that in mind
avatar
SLGray
Valued Member
Title :
Owner of 2 Forums
Gender : Male
Age : 44
Posts : 2385
Points : 4596
Reputation : 282
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
Awards :
View all awards
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on Thu 01 Sep 2016, 01:10

There might not be a limit on bandwidth, but there has to be some kind of limit on a free account.  Maybe there is a limit on the storage space.  If you have a large forum that has many members, it would quickly use up any limit.

If you could figure out a way that members can use their own accounts, it would be better.
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Thu 01 Sep 2016, 04:28

not possible unless our Master @Ange Tuteur find a way to let the Script ask users for there accounts Smile
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9685
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 01 Sep 2016, 10:42

Theoretically it's possible, but the user would need to register their own personal client id. I suppose after registration you could save that data to a profile field for the user, so they don't have to constantly input their id.
avatar
SLGray
Valued Member
Title :
Owner of 2 Forums
Gender : Male
Age : 44
Posts : 2385
Points : 4596
Reputation : 282
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
Awards :
View all awards
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on Thu 01 Sep 2016, 16:36

Please do not think I am saying that this tutorial is not great, but I just was wondering about the account.
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1650
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Fri 02 Sep 2016, 03:20

@Ange Tuteur
using profile feild to imgur api so it can be saved for each user to have his own access to his images in imgur
reflect
looks great idea
Thumb left
@SLGray
no lol im not thinking about that
i know your worry about storage and space for big forums but for me since i never owned a big forum i cant tell nor good is bad to use one api for the whole users
you right in worry about big forums i cant blame you
my forum got no more then 81 member im not a user of forumotion i use MyBB forum Script and i love it


i hope Ange Tuteur add this option for so i can pick MyBB instead of other Smile
im a little sick of other Embarassed

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum