NewProfiles are here!View user profiles guide
SMF
PHP

ImgLink for SMF

The ImgLink SMF plugin provides a clean single-function integration for Simple Machines Forum 2.x. imglink_upload_smf() handles config validation, cURL multipart upload with configurable connect timeout, and response parsing in one call. Strict PHP 8 types, BOM-free source, and no Composer dependencies ensure full compatibility with SMF's bootstrap across both SMF 2.0.x and 2.1.x.

Platform
SMF 2.x
Runtime
PHP 8.0+
Dependencies
Zero
CI Status
Passing

Requirements

  • PHP 8.0 or higher
  • SMF 2.0.x or 2.1.x
  • cURL PHP extension
  • ImgLink API key (free)
Used by

Classic community boards, hobby forums, guild sites

Download ZIP

What's included

Single-function API — imglink_upload_smf()
Configurable connect timeout
Strict PHP 8 typed parameters
BOM-free for SMF bootstrap compatibility
X-API-Key authentication
Returns structured array with CDN url and metadata
Compatible with SMF 2.0.x and 2.1.x
No Composer dependencies

Installation Guide

Follow these steps to integrate ImgLink with SMF.

01

Copy to SMF Sources/

Copy the plugin file into SMF's Sources directory.

cp src/plugin.php /path/to/smf/Sources/ImgLink.php
02

Register hook in Admin

In SMF Admin → Packages or Hooks, register imglink_upload_smf as your upload handler.

03

Create config.json

Create config.json next to your plugin file with your credentials.

{
  "apiBase": "https://imglink.cc",
  "apiKey": "YOUR_KEY_HERE",
  "timeoutSeconds": 30
}
04

Call in your upload hook

In your attachment or post handler, call imglink_upload_smf().

$upload = imglink_upload_smf($tmpFile, $config);
$url = $upload['url'];

Why host images on ImgLink?

Global CDN

Images served from a global edge network. Sub-100ms load times. No bandwidth cost to your forum server.

Scoped API Keys

One API key per forum. Revoke or rotate instantly. Keys never leave your config file — never hardcoded.

Retry Safety

Exponential backoff on every upload. Images never fail silently — retries handle transient network issues.

Ready to deploy ImgLink on SMF?

Download the plugin, add your API key, and go live in under 10 minutes. Free to use — no credit card required.