[ABD] URL + IMG Prompt while posting (friendly bbcode)

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany

[ABD] URL + IMG Prompt while posting (friendly bbcode)

Post by Balint »

This MOD is abandoned, please take a look at Better Prompt 4 BBCodes


MOD Title: URL + IMG Prompt while posting
MOD Description: When user clicks the URL or IMG button while posting, a Javascript prompt lets him input (image) URL (and linktext) and puts the complete bbcode in the posting textarea.

MOD Version: 0.2.0
phpBB Version: 3.0.0 GOLD

MOD Format: MODX

MOD Download: http://phpbb.krizsan.de/url_image_prompt_0.2.0.zip

Works with the following templates: prosilver, subsilver2

There are no update instructions from 0.1.0 to 0.2.0. Please use a clean copy of editor.js

Upon a request from saaiberke here I adapted the old userfriendly URL-input while posting-MOD from Tsjakkaa to fit phpBB 3.0.

Please feel free to leave comments, bug-reports and donuts.

:mrgreen:
Last edited by Balint on Sat Jun 11, 2011 3:00 pm, edited 5 times in total.
User avatar
SecondShoe
Registered User
Posts: 48
Joined: Thu Dec 13, 2007 7:16 pm

Re: [BETA] URL Prompt while posting

Post by SecondShoe »

Excellent mod! It is working on both ProSilver and SubSilver based styles in my forum. Thank You!
P.S. This mod must be included in the next version of phpBB I think.
User avatar
Kalipo
Registered User
Posts: 551
Joined: Mon Dec 08, 2003 1:47 pm

Re: [BETA] URL Prompt while posting

Post by Kalipo »

T H A N K Y O U

Sheesh, I agree this should be standard, but meh :roll:
My MOD request: MMORPG Workshop+
mezzomix23
Registered User
Posts: 40
Joined: Mon Feb 23, 2004 12:09 pm
Location: Switzerland

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by mezzomix23 »

Nice mod, but I have a request on that mod.

Well, it works well if you click on the URL button, you have the popup that asks for the link, then for the text...

But it doesn't work if you begin to type your text, write an URL link and then decide to make it more "friendly". If you select the URL you have type, then click on the URL button, I got the same 2 input boxes and when I validate the boxes, the result in not the expected one. Example:

I write:

Code: Select all

www.google.com
Then I select this text and click on the URL button. I get the first inputbox that shows me the following:

Code: Select all

Enter the URL
http://
(If I leave like that or retype

Code: Select all

www.google.com
the final result is the same)

Then I get the second inputbox:

Code: Select all

Enter link text
http://www.google.com
I validate...

The final result is:

Code: Select all

[url]www.google.com[/url]
instead of

Code: Select all

[url="http://www.google.com"]www.google.com[/url]
Is there any way to modify this to:
  • If nothing is selected ==> default behaviour
  • If a text is selected ==> first inputbox take the selection and puts it directly in the field and when finished, the selection has been updated correctl
Thank you in advance :)
Mezzomix23
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Balint »

Hi!

This is of course possible, I had another bugreport and will merge your request and the bugfix into a new version within a week.

Thank you for you interest and suggestions!


Greets,
Bálint
mezzomix23
Registered User
Posts: 40
Joined: Mon Feb 23, 2004 12:09 pm
Location: Switzerland

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by mezzomix23 »

That's a quick answer :)

Thank you for your reactivity ;)

I admit that I've tried to do it myself, but I've not managed to make it work. I look forward to see how you've done ^^

Someone opened a similar topic, but also included the request to have the same for IMG bbcode (http://www.phpbb.com/community/viewtopi ... 5#p4578995)

Do you think you will be able to do that also ?

Thank you
Mezzomix23
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Balint »

Will most definitely implement this aswell, should be a lot easier then the URL thingy :-)
mezzomix23
Registered User
Posts: 40
Joined: Mon Feb 23, 2004 12:09 pm
Location: Switzerland

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by mezzomix23 »

Great, you will have at least 2 guys happy :)

I can not understand why this is not by default... It so much userfriendly to have popups rather than typing all the code manually, especially for non-technical people ;)
User avatar
Brizzle
Registered User
Posts: 80
Joined: Tue Jan 15, 2008 10:53 pm
Location: Cambridge, MA

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Brizzle »

Thanks for posting this mod! It's a simple one to install, yet I think it's very helpful to forum users that aren't familiar with tagging things properly. It will definitely be a great help to the members of my forum.

Please let me know when you are able to add a prompt for the Img bbcode.
User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by *Capmaster* »

Thanks for working on this mod. We had Tsjakkaa's mod on our ver. 2 forum and we missed it in ver. 3.

Nice work! :mrgreen:
User avatar
Brizzle
Registered User
Posts: 80
Joined: Tue Jan 15, 2008 10:53 pm
Location: Cambridge, MA

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Brizzle »

I am trying to modify the mod to make it work in a similar way for the IMG tag, but I have no clue what I'm doing and it's not turning out too well.

I basically added these lines:

Code: Select all

if (bbnumber == 14)
	{
		var img = prompt('Enter the image URL' , 'http://');
		bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1], img);
	}

Code: Select all

function bbfontstyle(bbopen, bbclose, URL, linktext, img)

Code: Select all

if (img)
	{
		insert_text(bbopen + img + bbclose);
	}
From that, I get:

Code: Select all

[url=http://www.google.com/intl/en_ALL/images/logo.gif]undefined[/img][img][/img]
No good.
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Balint »

Please have a little patience, I'll figure it out tomorrow, today there's the final day in one of my projects which has top priority.
User avatar
Brizzle
Registered User
Posts: 80
Joined: Tue Jan 15, 2008 10:53 pm
Location: Cambridge, MA

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Brizzle »

Not trying to rush you or anything. Just seeing if I can puzzle this one out on my own or maybe someone else might have a suggestion.
mezzomix23
Registered User
Posts: 40
Joined: Mon Feb 23, 2004 12:09 pm
Location: Switzerland

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by mezzomix23 »

Tomorrow ? Cool :)

Many thanks
Mezzomix23
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany

Re: [BETA] URL Prompt while posting (friendly URL bbcode)

Post by Balint »

I couldn't resist...

(the instructions assume you already installed the URL part)

FIND

Code: Select all

	if (bbnumber == 16)
	{
		var URL = prompt('Enter the URL' , 'http://');
		var linktext = prompt('Enter link text' , URL.replace("http://", ""));
		bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1], URL, linktext);
	}
ADD AFTER

Code: Select all

	else if (bbnumber == 14)
	{
		var IMG = prompt('Enter Image URL' , 'http://');
		bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1], null, null, IMG);
	} 
FIND

Code: Select all

function bbfontstyle(bbopen, bbclose, URL, linktext)
REPLACE WITH

Code: Select all

function bbfontstyle(bbopen, bbclose, URL, linktext, IMG)
FIND

Code: Select all

	if (URL)
	{
		insert_text("[url=" + URL + "]" + linktext + bbclose);
	}
ADD AFTER

Code: Select all

	else if (IMG)
	{
		insert_text(bbopen + IMG + bbclose);
	}

Should work. Kudos to Brizzle for almost figuring it out...

Return to “[3.0.x] Abandoned MODs”