The default Embed code has direct link to the image placed first followed by direct link HTML, BBC and Markup codes. This tend to favor hotlinking without linking back to the image host.
I have redesigned it favoring linking back to the site as follows. Screenshot attached
Common Links
1. Image link
2. HTML (linked)
3. BBCode (linked)
4. Markdown (linked)
Direct links
1. Image URL
2. Thumbnail URL
3. Medium URL
Direct Full Image
1. HTML
2. BBCode
3. Markdown
Medium image (linked)
1. HTML
2. BBCode
3. Markdown
Thumbnail image (linked)
1. HTML
2. BBCode
3. Markdown
From line 250 of route.image.php change as below and upload it to /app/routes/overrides/
To view this in action check https://gifyu.com/image/0W2
I have redesigned it favoring linking back to the site as follows. Screenshot attached
Common Links
1. Image link
2. HTML (linked)
3. BBCode (linked)
4. Markdown (linked)
Direct links
1. Image URL
2. Thumbnail URL
3. Medium URL
Direct Full Image
1. HTML
2. BBCode
3. Markdown
Medium image (linked)
1. HTML
2. BBCode
3. Markdown
Thumbnail image (linked)
1. HTML
2. BBCode
3. Markdown
From line 250 of route.image.php change as below and upload it to /app/routes/overrides/
PHP:
// Embed codes
$embed = [];
$image_full = [
'html' => '<img src="'.$image['url'].'" alt="'.$image['filename'].'" border="0" />',
'markdown' => '!['.$image['filename'].']('.$image['url'].')'
];
$image_full['bbcode'] = G\html_to_bbcode($image_full['html']);
$embed_full_linked['html'] = '<a href="'.$image['url_viewer'].'">'.$image_full['html'].'</a>';
$embed_full_linked['bbcode'] = G\html_to_bbcode($embed_full_linked['html']);
$embed_full_linked['markdown'] = '[!['.$image['filename'].']('.$image['url'].')]('.$image['url_viewer'].')';
$embed['full-linked'] = [
'label' => _s('Common Links'),
'entries' => [
[
'label' => _s('Image link'),
'value' => $image['url_viewer']
],
[
'label' => 'HTML',
'value' => htmlentities($embed_full_linked['html'])
],
[
'label' => 'BBCode',
'value' => $embed_full_linked['bbcode']
],
[
'label' => 'Markdown',
'value' => $embed_full_linked['markdown']
],
]
];
$embed['direct-links'] = [
'label' => _s('Direct links'),
'entries' => [
[
'label' => _s('Image URL'),
'value' => $image['url']
],
[
'label' => _s('Thumbnail URL'),
'value' => $image['thumb']['url']
],
]
];
$embed['full-image'] = [
'label' => _s('Direct Full image'),
'entries' => [
[
'label' => 'HTML',
'value' => htmlentities($image_full['html'])
],
[
'label' => 'BBCode',
'value' => $image_full['bbcode']
],
[
'label' => 'Markdown',
'value' => $image_full['markdown']
],
]
];
if($image['medium']) {
$embed['direct-links']['entries'][] = [
'label' => _s('Medium URL'),
'value' => $image['medium']['url']
];
}
if($image['medium']) {
$embed_medium_linked = array(
"html" => '<a href="'.$image['url_viewer'].'"><img src="'.$image['medium']['url'].'" alt="'.$image['filename'].'" border="0" /></a>'
);
$embed_medium_linked['bbcode'] = G\html_to_bbcode($embed_medium_linked['html']);
$embed_medium_linked['markdown'] = '[!['.$image['medium']['filename'].']('.$image['medium']['url'].')]('.$image['url_viewer'].')';
$embed['medium-linked'] = [
'label' => _s('Medium image (linked)'),
'entries' => [
[
'label' => 'HTML',
'value' => htmlentities($embed_medium_linked['html'])
],
[
'label' => 'BBCode',
'value' => $embed_medium_linked['bbcode']
],
[
'label' => 'Markdown',
'value' => $embed_medium_linked['markdown']
],
]
];
}
$embed_thumb_linked = [
'html' => '<a href="'.$image['url_viewer'].'"><img src="'.$image['thumb']['url'].'" alt="'.$image['filename'].'" border="0" /></a>'
];
$embed_thumb_linked['bbcode'] = G\html_to_bbcode($embed_thumb_linked['html']);
$embed_thumb_linked['markdown'] = '[!['.$image['thumb']['filename'].']('.$image['thumb']['url'].')]('.$image['url_viewer'].')';
$embed['thumb-linked'] = [
'label' => _s('Thumbnail image (linked)'),
'entries' => [
[
'label' => 'HTML',
'value' => htmlentities($embed_thumb_linked['html'])
],
[
'label' => 'BBCode',
'value' => $embed_thumb_linked['bbcode']
],
[
'label' => 'Markdown',
'value' => $embed_thumb_linked['markdown']
],
]
];
To view this in action check https://gifyu.com/image/0W2