Page 1 of 2

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

Posted: 21 Dec 2011, 22:09
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
s1.jpg (24.94 KiB) Viewed 5644 times

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

Posted: 21 Dec 2011, 22:13
by Terr0r
Have you a screenshot and/or live demo off this ?

Greets Terr0r

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

Posted: 21 Dec 2011, 22:14
by FTH
1rst post edited with screenshot ;)

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

Posted: 21 Dec 2011, 22:44
by slash
demo?

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

Posted: 21 Dec 2011, 22:48
by FTH
http://graphogames.fr/demo/index.php

Login : testuser
Password : testuser123456

;)

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

Posted: 21 Dec 2011, 22:51
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

Posted: 21 Dec 2011, 22:52
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

Posted: 21 Dec 2011, 22:55
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

Posted: 21 Dec 2011, 23:01
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

Posted: 21 Dec 2011, 23:05
by slash
sorry but I don't understand where im going to vlik for testing this mod ! XD