phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Javascript popup for bbcode URL


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Apr 29, 2010 7:23 am 
Post subject: Javascript popup for bbcode URL

Hi!

I would like to give my members this function for the URL bbcode (please see attached screenshot).

I have found this:
http://www.phpbbhacks.com/download/4745
But I only want the URL part.
Does anyone have an idea on how to do that?

Thank you!

/Holger



8425_box_001_1.jpg
 Description:
 Filesize:  4.95 KB
 Viewed:  9323 Time(s)

8425_box_001_1.jpg


Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 430
Location: Québec


flag
PostPosted: Thu Apr 29, 2010 5:21 pm 
Post subject: Re: Javascript popup for bbcode URL

I'll suggest this, but make sure you save your files first, I don't offer any guarantee whatsoever. I'd be surprised if it's as simple as that, but otherwise I don't know enough JavaScript to fix that all.


Code:
#
#-----[ OPEN ]------------------------------------------

# templates/YOUR_TEMPLATE/posting_body.tpl
#
#-----[ FIND ]---------------------------------------------------
#

</script>

#
#-----[ BEFORE, ADD ]---------------------------------------------------
#

function BBCurl() {
   var FoundErrors = '';
   var enterURL   = prompt("Enter your URL", "http://");
   var enterTITLE = prompt("Enter the webpage title", "LINK");
   if (!enterURL)    {
      FoundErrors += " You have not entered the URL yet!";
   }
   if (!enterTITLE)  {
      FoundErrors += " You have not entered the title yet!";
   }
   if (FoundErrors)  {
      alert("Error!"+FoundErrors);
      return;
   }
   var ToAdd = "[URL="+enterURL+"]"+enterTITLE+"[/URL]";
   document.post.message.value+=ToAdd;
   document.post.message.focus();
}


#
#-----[ FIND ]---------------------------------------------------
#

           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

           <input type="button" class="button" name="url" value="URL" style="text-decoration: underline; width: 40px" onClick="BBCurl()" onMouseOver="helpline('w')" />


#
#
#
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Apr 30, 2010 7:24 am 
Post subject: Re: Javascript popup for bbcode URL

Wooops! It seems to work! icon_lol.gif

Thanks a lot!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 430
Location: Québec


flag
PostPosted: Fri Apr 30, 2010 5:48 pm 
Post subject: Re: Javascript popup for bbcode URL

Well, then I'm surprised icon_razz.gif But also glad I could help icon_wink.gif
Back to top
Slackervaara
Board Member



Joined: 01 Jan 2009

Posts: 70



PostPosted: Sat May 01, 2010 6:52 am 
Post subject: Re: Javascript popup for bbcode URL

I use Advanced BBcode Box 5.1.0 and it has this feature plus much more.
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sat May 01, 2010 7:22 pm 
Post subject: Re: Javascript popup for bbcode URL

Advanced BBcode Box 5.1.0 has too much!
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0293 seconds using 18 queries. (SQL 0.0033 Parse 0.0024 Other 0.0237)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo