How I can replace a specific string of text anytime it appears?

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
jtb33
Registered User
Posts: 49
Joined: Thu Dec 02, 2004 11:36 pm

How I can replace a specific string of text anytime it appears?

Post by jtb33 » Sun Jun 24, 2018 10:31 pm

My title is a bit of a stretch, because it won't be a static item.

Basically, anytime someone posts a link to a youtube video, I want it to automatically encapsulate it in the BBVIDEO tags even if they have explicitly used the URL tags on it so that it will always embed the video instead of a link to it.

Is this possible?

User avatar
Lumpy Burgertushie
Registered User
Posts: 64877
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: How I can replace a specific strong of text anytime it appears?

Post by Lumpy Burgertushie » Sun Jun 24, 2018 10:53 pm

install this: viewtopic.php?f=616&t=2414716&p=1482099 ... #p14688926
that way people just have to post the link and it will embed the video in the post.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

jtb33
Registered User
Posts: 49
Joined: Thu Dec 02, 2004 11:36 pm

Re: How I can replace a specific strong of text anytime it appears?

Post by jtb33 » Sun Jun 24, 2018 10:56 pm

Thanks. Already installed that and it almost works like I need it to. Problem is that if someone has explicitly used the

Code: Select all

[URL] [/URL]
tags for youtube links, it will ignore those youtube videos and just post a hyperlink rather than imbed them.

User avatar
Lumpy Burgertushie
Registered User
Posts: 64877
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: How I can replace a specific strong of text anytime it appears?

Post by Lumpy Burgertushie » Sun Jun 24, 2018 11:29 pm

why would anyone do that? personally, the only time I ever use the url bbcode is the url= bbcode .
if you post a url phpbb automatically makes it a link anyway so there is really no reason to use the url bbcode.

post some instructions to explain to people how to do it properly. that seems to be the easiest way to solve a lot of those type of things.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

Toxyy
Registered User
Posts: 465
Joined: Mon Oct 24, 2016 3:22 pm

Re: How I can replace a specific strong of text anytime it appears?

Post by Toxyy » Mon Jun 25, 2018 1:15 am

jtb33 wrote:
Sun Jun 24, 2018 10:56 pm
Thanks. Already installed that and it almost works like I need it to. Problem is that if someone has explicitly used the

Code: Select all

[URL] [/URL]
tags for youtube links, it will ignore those youtube videos and just post a hyperlink rather than imbed them.
That sounds like a user error as you've already provided them with the means of making it embedded. What if they really did only want to post a url to youtube? Then you'll have users trying to do that case contact you instead.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

jtb33
Registered User
Posts: 49
Joined: Thu Dec 02, 2004 11:36 pm

Re: How I can replace a specific strong of text anytime it appears?

Post by jtb33 » Mon Jun 25, 2018 2:22 pm

I think a lot of the reason people do that is that there was a time that forum software didn't auto-convert links and unless you used the BBCODE it would just be a non-hyperlinked URL.

We all know how well users will read the FAQ or other info, which is why I was looking for a programmatic way around it.

User avatar
KevC
Support Team Member
Support Team Member
Posts: 68248
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How I can replace a specific strong of text anytime it appears?

Post by KevC » Mon Jun 25, 2018 2:40 pm

Toxyy wrote:
Mon Jun 25, 2018 1:15 am
What if they really did only want to post a url to youtube?
They can just put code tags around it and it won't be parsed.

Which is more likely to be the outcome? That they do or don't want the link parsed?
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: invenio, stevemaury and 45 guests