Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: njtweb on May 16, 2018, 03:06:45 PM

Title: Clickable telephone number
Post by: njtweb on May 16, 2018, 03:06:45 PM
I searched the mods and didn't see anything for this, unless there is one with a different name. Is there a bbcode to make a telephone number clickable from a mobile or tablet without using admin html tags?
Title: Re: Clickable telephone number
Post by: Kindred on May 16, 2018, 05:00:59 PM
no.


that would not be on the server side, anyway...  that would be on the client side of things (like, if you have Skype turned on and the number-recognizer active)
Title: Re: Clickable telephone number
Post by: Illori on May 16, 2018, 05:32:23 PM
https://developers.google.com/web/fundamentals/native-hardware/click-to-call/

looks like you could possibly create a new bbc tag to support that.
Title: Re: Clickable telephone number
Post by: njtweb on May 16, 2018, 10:06:39 PM
Quote from: Illori on May 16, 2018, 05:32:23 PM
https://developers.google.com/web/fundamentals/native-hardware/click-to-call/

looks like you could possibly create a new bbc tag to support that.

Don't know anything about that but I'll try. I remember way back in 2007 I ran a vbulletin site and we made bbcodes in the in admin interface for everything like all of the various sports sites embedded media, podcasts and such. It was actually a part of vbulletin. I'll research how to do it in SMF.
Title: Re: Clickable telephone number
Post by: Sir Osis of Liver on May 16, 2018, 10:10:44 PM
There's a mod you can use to create bbc tags, I'm using it on one of my forums.

https://custom.simplemachines.org/mods/index.php?mod=3864
Title: Re: Clickable telephone number
Post by: njtweb on May 17, 2018, 06:43:26 AM
Quote from: Sir Osis of Liver on May 16, 2018, 10:10:44 PM
There's a mod you can use to create bbc tags, I'm using it on one of my forums.

https://custom.simplemachines.org/mods/index.php?mod=3864

Installed, we'll see how it goes. Do you have any tips especially somewhere where I can get instructions how to make configure my first one?
Title: Re: Clickable telephone number
Post by: njtweb on May 17, 2018, 07:55:59 AM
Got it installed, configured the click to call bbc. Problem is I used used Illori's suggestion https://developers.google.com/web/fundamentals/native-hardware/click-to-call/ as an example. The example doesn't provide any kind of idea what to use as wildcards to format the phone number correctly. When you do a test it changes the phone number to the phone number in the example. I tried ?? ** as wildcards but that doesn't do anything either.
Title: Re: Clickable telephone number
Post by: Gwenwyfar on May 19, 2018, 07:31:01 PM
What do you mean wildcards? Do you mean to ask variables? Your bbc should simply replace the phone number with the one used in the bbc.
Title: Re: Clickable telephone number
Post by: finnich on May 19, 2018, 10:51:46 PM
a wildcard is a symbol used to replace or represent one or more characters. Wildcards are typically either an asterisk (*), which represents one or more characters or question mark (?), which represents a single character.
Title: Re: Clickable telephone number
Post by: shawnb61 on May 19, 2018, 11:32:28 PM
Just as an FYI...  If basic html is enabled, this works in SMF2.1, but not in 2.0:
<a href="tel:14155555555">some text</a>

On cellphones, it dials.  On desktops, it will launch Skype or whatever your browser points those to. 


EDIT:  I think it's a pretty straightforward change to add support for tel: to 2.0...
Title: Re: Clickable telephone number
Post by: shawnb61 on May 20, 2018, 12:36:57 AM
I believe njtweb is wondering how to define a mask of sorts to define the phone # for substitution (I think we're talking more of a "mask" than a "wildcard" here). 

I don't think that mod is quite that detailed.  It appears to just use {option} & {content} as placeholders and do a simple substitution.

My guess is that you need to use a  type like:
[tag=option]content[/tag]

And html like:
<a href="tel:{content}">{option}</a>

And usage will look like:
[phone=georges number]4155555555[/phone]

Anything deeper than that, I think you'll need to go to the mod's support thread here:
https://www.simplemachines.org/community/index.php?topic=523396.0
Title: Re: Clickable telephone number
Post by: njtweb on May 20, 2018, 11:44:35 AM
Yes, a mask. Sorry not too versed in the lingo.

I tried adding <a href="tel:{content}">{option}</a> to the html field.


But this is all I get when I test{option}
Title: Re: Clickable telephone number
Post by: shawnb61 on May 20, 2018, 11:51:16 AM
Did the type you chose include content & option, as shown above?

The mod has a handy test link. 

Again - we're now deep into how to use the mod - further discussion on how to use the mod should take place on the mod support thread - so other users of the mod (who will be much more familiar with it...) can help:
https://www.simplemachines.org/community/index.php?topic=523396.0
Title: Re: Clickable telephone number
Post by: njtweb on May 20, 2018, 01:13:57 PM
I posted in that thread
Title: Re: Clickable telephone number
Post by: njtweb on May 20, 2018, 02:57:03 PM
Here's the answer!

https://web-develop.ca/index.php?topic=239.0