Page 1 of 1

Imagelink with extra hostname

Posted: 29 Mar 2010, 21:18
by mini2mini
Hello, i'm new here, so hello guys :)

I've tried to make a custom bbcode for a few weeks now, but i can't get it finished because it's a little over my head.
Then i stumbled over your site here.

I want to make something like this:

[center]Image
Hoster: phpbb3bbcodes
[/center]

A clickable image that links to a page/file and a little description underneath it where the file is hosted.
(the name between www. and .com/.net)

Sadly i only came up with the linkable image bbcode:

Code: Select all

[Examplelink]{URL}[/Examplelink]

Code: Select all

<div align="center"><a href="{URL}" target="_blank"><img src="http://www.phpbb3bbcodes.com/images/smilies/icon_question.gif" /></a></div>
and i tried all sorts of things to get the hostername out of the link and write it beneath the icon.
i tried various combinations of

Code: Select all

{TEXT}, {SIMPLETEXT} and a few others that i came across instead of {URL}
is it possible to make the link in the image file work and display only the hostername as a readable text beneath it?
Or am i trying some things that can't work?

If anyone could help me in this case, thank you very much.

Re: Imagelink with extra hostname

Posted: 29 Mar 2010, 22:25
by cisco007
will something like this work?

Code: Select all

[Examplelink]{URL},{TEXT}[/Examplelink]

Code: Select all

<div align="center"><a href="{URL}" target="_blank"><img src="http://www.phpbb3bbcodes.com/images/smilies/icon_question.gif" /></a><br />Hosted at: {TEXT}</div>

and the helpline would be:

Code: Select all

[Examplelink]file url,name of site[/Examplelink]

Re: Imagelink with extra hostname

Posted: 29 Mar 2010, 23:17
by mini2mini
thanks for the tip, somehow i didn't think of that.

But this would require people to write a ",hostername" after the address, i don't think they would get it all.
And if they forget the ",hostername" after the address, the bbcode refuses to work.

Is there a way to split the inputted address via the URL tag and use the domainname for this?
This would be as automatic as it could be and nobody could get it wrong.
I think this doesn't work with the URL tag, there must be a combination of some text tags that do this...

Re: Imagelink with extra hostname

Posted: 29 Mar 2010, 23:32
by mini2mini
hmm, perhaps the youtube tag can help with this (even if it does the reverse, it adds something to the link at the end)

{TEXT}watch?v={TEXT1}
and
{TEXT}v/{TEXT1}&rel=en&fs=1

could this be javascript based?
perhaps this could work in reverse somehow and delete the http://www. and .com at the end of it.

Re: Imagelink with extra hostname

Posted: 30 Mar 2010, 01:25
by cisco007
well it can't be that hard to put in the bbcode tag

Code: Select all

[imagelink]http://www.phpbb3bbcodes.com/images/smilies/icon_question.gif,phpbb3bbodes[/imagelink]
since i am guessing this will be your board, you could add an announcement how to do this!

but, i can try to see what i can come up with!

Re: Imagelink with extra hostname

Posted: 30 Mar 2010, 18:03
by mini2mini
but, i can try to see what i can come up with!
thanks, that would be great :)