[Snippet] Add a box (in popup) to add URL image

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

[Snippet] Add a box (in popup) to add URL image

Post by FTH »

Author : FTH
Description : Insert an image via a popup

Open file styles/prosilver/template/posting_buttons.html

Find :

Code: Select all

var imageTag = false;
After add :

Code: Select all

function BBCimg()
        {
           var FoundErrors = '';
           var enterURL   = prompt('{L_ENTER_URL}');
           if (!enterURL)    {
              FoundErrors += "{L_ENTER_URL_EXPLAIN}";
           }
           if (FoundErrors)
           {
              alert("{L_ERROR_URL} : "+FoundErrors);
              return;
           }
           var bbtags = "[img]"+enterURL+"[/img]";
           document.forms[form_name].elements[text_name].value+=bbtags;
           document.forms[form_name].elements[text_name].focus();
        }
Find :

Code: Select all

<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
Replace with :

Code: Select all

<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="BBCimg()" title="{L_BBCODE_P_HELP}" />
Open file language/en/posting.php

Find :

Code: Select all

'EMPTY_REMOTE_DATA'			=> 'File could not be uploaded, please try uploading the file manually.',
After add :

Code: Select all

'ENTER_URL'                 => 'Enter URL of your image',
	'ENTER_URL_EXPLAIN'         => 'You must enter the link to your image',
	'ERROR_URL'                 => 'Error',
Screenshot :
s1.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by FTH on 21 Dec 2011, 20:14, edited 1 time in total.

[Snippet] Add a box (in popup) to add URL image

Post by Terr0r »

Have you a screenshot and/or live demo off this ?

Greets Terr0r

[Snippet] Add a box (in popup) to add URL image

Post by FTH »

1rst post edited with screenshot ;)

[Snippet] Add a box (in popup) to add URL image

Post by slash »

demo?

[Snippet] Add a box (in popup) to add URL image

Post by FTH »

http://graphogames.fr/demo/index.php

Login : testuser
Password : testuser123456

;)

[Snippet] Add a box (in popup) to add URL image

Post by slash »

Code: Select all

General Error
template->_tpl_load_file(): File ./styles/prosilver/template/mods/presentation_form/presentation_form_body.html does not exist or is empty

[Snippet] Add a box (in popup) to add URL image

Post by FTH »

arrrrrf it's an old mod, i'm going to delete that pffffffffffff

[Snippet] Add a box (in popup) to add URL image

Post by FTH »

http://graphogames.fr/demo/viewtopic.ph ... 3&p=77#p77

test here, i'm login with the user account, and it's working perfectly

[Snippet] Add a box (in popup) to add URL image

Post by Arnevb »

Works fine, only the error message for the invalid URL doesn't work here in chrome.

[Snippet] Add a box (in popup) to add URL image

Post by slash »

sorry but I don't understand where im going to vlik for testing this mod ! XD