Imgur extension for phpBB

  • 3 min read

Imgur extension for phpBB.

Build Status Latest Stable Version Code Quality License

With this extension you can click on the Imgur posting button and select the image(s) you want to upload.

If the upload is successful it will add the image in the topic, private message or signature content. You can choose in the Administration Control Panel to show the uploaded image as plan text or with BBCode as URL, image (default) or thumbnail.

Other extensions, such as Markdown, can add custom output types.

Features

  • Change Imgur API data though the ACP
  • Optionally, set an album where all the images will be uploaded to
  • Compatibility with ABBC3 extension
  • CSRF protection
  • Administrator log on configuration changes
  • Insert BBCode/text at cursor position
  • Album download link in the ACP for backup
  • Upload progress bar
  • Compatibility with QuickReply Reloaded extension
  • Compatibility with mChat extension
  • Drop-down menu in posting box button
  • Imgur tab in posting box options
  • Save some user preferences using localStorage and sessionStorage

Preview

ACP settings ACP settings API ACP output settings Topic Output menu Output tab

(Click to view in full size)

Requirements

  • PHP 5.6 or greater
  • phpBB 3.2 or greater
  • Composer (for development only)
  • Imgur API data (client_id and client_secret)

Support

Imgur API

  • Create an Imgur account, if you don’t have one already
  • Register your application at https://api.imgur.com/oauth2/addclient
  • Type an application name
  • Select OAuth 2 authorization with a callback URL
  • Set Authorization callback URL to http://domain.tld/app.php/imgur/authorize, use https:// if you have an SSL certificate
  • Verify that the previous URL works
  • Type your email and a short description
  • After clicking Submit you should get a client_id and client_secret

Configuration

  • Go to your Administration Control Panel > Extensions > Imgur settings
  • Set the Client ID, Client Secret and optionally an Album
  • Click on Submit
  • Once you have the required API data, click on the authorization link shown above
  • A new window will popup to authorize the application
  • Login to your Imgur account and grant access
  • The window will close itself when it’s done, or show an error message

To customize the look and feel:

  • Move into {PHPBB_ROOT}/ext/alfredoramos/imgur/
  • Copy the styles/prosilver/ directory to styles/{STYLE}/
  • Edit the file styles/{STYLE}/theme/css/imgur.css as needed

Note: If your style doesn’t inherit from prosilver, you should follow the steps above even if you don’t want to change any file.

Installation

  • Download the latest release
  • Decompress the *.zip or *.tar.gz file
  • Copy the files and directories inside {PHPBB_ROOT}/ext/alfredoramos/imgur/
  • Run composer install --prefer-dist --no-dev inside {PHPBB_ROOT}/ext/alfredoramos/imgur/
  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Enable and confirm

Uninstallation

  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Disable and confirm
  • Go back to Manage extensions > Imgur > Delete data and confirm

Upgrade

  • Uninstall the extension
  • Delete all the files inside {PHPBB_ROOT}/ext/alfredoramos/imgur/
  • Download the new version
  • Install the extension