Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Hi

Let see if I can sort this out so you understand.
On my britbike forum
https://www.britbike.com/forums/

I use active links and have done it for a long time. certain words are converted to links and points often to ebay in order to generate a little revenue.
It has worked fine until a couple days ago when a member alerted me that it can screw up for example image urls.
The word is "triumph" which is a motorcycle brand in this case and the meaning was to create "triumph" active links.
Then a member Stuart embedded an image from another site in a topic and it didn't display properly.
see below link but be aware of that I have now deleted the active link for the word "triumph"
the reason was that the linked image had the word triumph in their url.

https://www.britbike.com/forums/ubb...linked-images-display-problem#Post840886

Could it be possible to fix this so that when we embed or use an img url that the active link feature does not turn the words in the image url and into a <a href=""> link ???

Added a new question, Could it be set so that when a word is in a url the world will not be converted to an active link

such as this link https://www.triumph.com or https://www.triumph.com/image.jpg
neither of the above two words "triumph" urls should be converted to an active link.. could it be done??

Thanks

Last edited by Morgan; 02/24/2021 2:14 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,289
Likes: 115
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,289
Likes: 115
There are two types of filters in UBB.threads; the censor is a filter that affects post content being inserted into the database and is a simple tool which does a simple find/replace, whereas the Active Text is a powerful tool which preforms a regex match based on the keywords in your active text settings when the content is being read from the database to the user requesting the post content. With both of these tools we're instructing PHP to replace all matches within the post body.

The recommendation for you is to use a more broad set of keywords for your active text entries; instead of "triumph" which is a fairly common english word (meaning victory), try matching "triumph bikes" to get around the regex matching the keywords within URL or Image entries. Examples would be instead of "oil"/"oil filter" or "air"/"air filter".


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
1 member likes this: isaac
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Hi Gizmo,

I hear you.

What I find disturbing is that I used for example this Active text
TRIUMPH|<a href='http://ebay.us/l6PTd4'>Triumph</a>
it created this result for an image link
[Linked Image from <a href='http://ebay.us/l6PTd4'>Triumph</a>-spares.co.uk]

What if I instead use below with a extra space after TRIUMPH ??? would it get same result??
TRIUMPH |<a href='http://ebay.us/l6PTd4'>Triumph</a>

I think I have to do some tests with another word that is better to use.

Last edited by Morgan; 02/24/2021 5:28 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
test result, if I add below with the extra space after the word TRIUMPH , after submitting the space is auto removed so same negative result as before
TRIUMPH |<a href='http://ebay.us/l6PTd4'>Triumph</a>


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,289
Likes: 115
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,289
Likes: 115
This is by design, all input fields are run through PHP's trim function; all trimming functions are used to remove any whitespace (empty space such as a space, tab, new line, carriage return, nul-byte, vertical tab) from the starting and end of any text entry boxes.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Ok the trim feature seems good but in this case it doesn’t help me.
I wonder why the active link feature changes part of a string like www.triumph-spares.com could it be tha there is a “.” before and “-“ after the word “triumph” ???

I will need to do some more tests.


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Here is a test I did
https://www.britbike.com/forums/ubbthreads.php/topics/841074/testing-active-link#Post841074

I have added an active link to the word "test222" the word which I use to name a folder.
Also another active link "test555" I have added a .gif named "test555.gif" within the "test222" folder
https://www.britbike.com/test222/test555.gif

See that the word "test222" becomes a link even if it is next to a "." or "/" or "-" but not if its next to a letter as in "a".

I notice also that it handles up to two links but not three
see the difference in this section but using britbike forum link above.

Now I know a little more but I am not happy because how it works.
Is there a way to change so that it also counts the "." or "/" or "-" signs so example "/test222/" would be counted as what it is and not"test222" ???
in another fraise could it be set so that "test222/test555.gif" is counted as one word and not as three separate words with "/" and "." in between ?


I think it make the active links work more correct.
Thanks for your help

Last edited by Morgan; 02/25/2021 6:03 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
After my active link test on BritBike forum a member asked how it went. I gave him the link to this thread and he read it and made a few comments.
He informed me following.
Quote
It is common knowledge that forum users will add links to forum posts that will be subject to be broken by the ActiveText function.
Morgans note: It was not common knowledge to me but maybe for programmers.

Gizmo's wrote:
Quote
we're instructing PHP to replace all matches within the post body.
The member's comment is
Quote
This tells me that the PHP has been written to limit its text pattern search to the post "body" which is an HTML tag. So, if the search can be limited to <body>Content...</body>, it is clear that text within a link can be excluded. This should be a simple problem for a programmer to fix. PHP has all the tools to do this with the addition of a few lines of code that set up the search conditions.

Gizmo wrote:
Quote
The recommendation for you is to use a more broad set of keywords...

After thinking of this my (Morgan's) comment is that it's does not work. For example the motorcycle brand "Triumph" appear probably more than 250.000 times and it just does not work to have to combine it with another specific word. One should be able to post a link to www.triumph.com without it being corrupt.
The suggestion is to ask UBBCentral to address this as a bug that needs to be fixed.

If the Regex search can be limited to the BODY, Could it be be set to exclude links? or at least to count characters/letters/numbers so that
example word "Triumph" is not matched with "www.triumph.com" ???

It is my suggestion for coming version. Is it ok to suggest it here or should I write a new thread in the >>>Feedback & Suggestions forum?

My request is of course to UBBCentral..
I know that the Volunteer develop team is doing a fantastic and great job in all respect and which I am so thankful for.

Thanks for your service!!!

Last edited by Morgan; 02/27/2021 6:52 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
I'll put this on my list to look at further. morgan, thank you for your posts. gizmo, thank you for your solutions and working through this long topic.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Thanks Isaac I sure appreciate that you’ll look into this.


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
1 member likes this: isaac
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Could it be be set to exclude links? or at least to count characters/letters/numbers so that
example word "Triumph" is not matched with "www.triumph.com" ???


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
No, because the Active Text tool replaces the final txt that is displayed in the post in real time. Unlike the censor (word/phrase) replacement, which replaces the text first, before doing any else to the user input.

censor recommends that you rebuild the posts/private messages/sigs after making changes to your list.

Active Text does just as its name suggests, it actively changes the text on the fly. in real time as the post page is being created.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Originally Posted by isaac
No, because the Active Text tool replaces the final txt that is displayed in the post in real time. Unlike the censor (word/phrase) replacement, which replaces the text first, before doing any else to the user input.

Active Text does just as its name suggests, it actively changes the text on the fly. in real time as the post page is being created.

Isaac, I think you mis-understand me. What I mean is that the PHP should not change words that don't matches.

If I set active link in CP to
triumph|<a href='https://domain.com'>triumph</a>

It should only change it to a active link if it matches the word "Triumph" as a singular word or in a line like this "It is a blue Triumph motorcycle"

The active link should not change and corrupt an image url "https://triumph.com/image.jpg" or a regular link "https://triumph.com"

triumph|<a href='https://domain.com'>triumph</a>

triumph = match this becomes a active link
https://triumph.com = no match
triumph222 = no match
/triumph.jpg = no match

OK so ?

Last edited by Morgan; 03/01/2021 10:05 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
PHP doesnt care about human language. it is replacing the letter pattern as they are found.

triumph = triumph

it doesnt care what surrounds the character combinations that form human language.

Originally Posted by Morgan
triumph = match this becomes a active link
https://triumph.com = no match
triumph222 = no match
/triumph.jpg = no match
^^^ THIS IS INCORRECT

in each 4 of the lines you used in your example, they all include a match of the character pattern which php is being instructed to match.

please reread my first reply to you. censor vs active-text. it includes a definition of what each function does and when it is applied. also reread the reply given to you by gizmo. your search string should be more specific. you are currently attempting to match a broad pattern of letters using a tool that works as designed. the tool is called "active text" not "active words"

https://www.php.net/manual/en/function.preg-match.php


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Will read it Isaac, I have re read all what Gizmo and you wrote above


I may be wrong but I think I'm also a bit right.
I have a live example here
https://www.britbike.com/forums/ubbthreads.php/topics/841074/testing-active-link#Post841074

The active text setting
test555|<a href='https://britbike.com/test555'>test555</a>
test222|<a href='https://britbike.com/test222'>test222</a>
uploaded to the server is a folder "test222" and an image "test555.gif"

Within the test thread I wrote this
[Linked Image]
The result became this, what you don't see is that the urls are corrupted.

Quote
PHP doesnt care about human language. it is replacing the letter pattern as they are found.
Yes when characters like "/" or "." or "-" is in front or behind and NO when there is a letter or number.
Like the word "atest222" or "test222a" would have become links but they don't because they don't match. it starts or ends with an "a"
it is the same with "test555gif" ends with "gif" without "." in between.

[Linked Image]

I am interested in creating active links from one word only and in rare cases two words.

When I posted the test above I received one reply from a member Henry. We sent PM's to each other in order for me to understand it better.
remember I am only a user by trade..

I will include some of the conversation, Below are Henry's words. PLEASE take it for what it is a BritBike forum member trying to help me I have explained to him that UBB dev's are working on a volunteer basis

Quote
Henrys words>> ...the Active Text is a powerful tool which preforms a regex match based on the keywords in your active text settings when the content is being read from the database to the user requesting the post content.

Software is typically built based on "user cases". Programmers then build and test software that conform to the user case requirements. That being said, my opinion is that the ActiveText function was built based on either a faulty user case or faulty programming of a valid use case. It is common knowledge that forum users will add links to forum posts that will be subject to be broken by the ActiveText function. This is clearly a failure of the development team. FYI, Regex is simply a set of pre-programmed text pattern recognition functions similar to many development languages.

Gizmo said >> ...we're instructing PHP to replace all matches within the post body.

Henrys reply >>>
This tells me that the PHP has been written to limit its text pattern search to the post "body" which is an HTML tag. So, if the search can be limited to <body>Content...</body>, it is pretty clear that text within a link can be excluded. This should be a simple problem for a programmer to fix. PHP has all the tools to do this with the addition of a few lines of code that set up the search conditions.

Gizmo >>
The recommendation for you is to use a more broad set of keywords...

Henry replied>>>
My recommendation is for UBB to fix the software!
UBB wrote a program in the PHP language that modifies the content of the body of the post.

Henry also wrote >>>
ActiveText is the UBB marketing name for what is commonly known as Regex. BODY is a technical term meaning the part of a web page that includes the page content the user reads. UBB has programmed the search in PHP to search only in the BODY of the page. If ActiveText searched and replaced content in other sections of the page such as HEAD, the entire page could be broken. So it stands to reason that if ActiveText can be programmed to exclude HEAD, it can be programmed to exclude links, images and any other tags. So my question asks to please explain why the search cannot be programmed do this. This explanation could be useful to help you understand the limitations of ActiveText so you can better use it to your benefit.
//Henry



If active text could be written so that it cannot not brake links, urls, images than the forum would become so much better in my opinion.
Example .. sponsors name could become a link so that it is always active text link to the sponsors site. But when the sponsor link to their images in posts it should not have to be broken..

Sorry for the ranting I simply am trying to give feedback to make it better. smile

Thanks for your help you know I love you all. grin

PS If I am totally wrong you can absolutely delete the thread.

Last edited by Morgan; 03/01/2021 12:25 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
To be honest I do not use this feature at all for the very same reasons.
In fact at this site it used to be if I posted
UBBWiki
That was a active link.
Not anymore so I assume it was deleted for the very same reason or it got changed to something else.

Besides all the items they have still on their todo list which I am sure they have.
I don't think the active text feature has even been addressed yet.
They have been busy just updating the software to be compatible with modern server software trying to tweak items along the way.
Plus providing some additional benefits that we can enjoy.

So be patient Grasshopper..


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
1 member likes this: Morgan
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Thanks Ruben for your input,
I do understand there are loads of work to modernize.
Active links has been on my mind a while and I added a couple words and it only took a day before I got complaints about broken links,
We’ll see if something good comes out of it in the end.
Time will tell and I’ll try to be patient and sit still on a straw and wait. I have jumped to much right now I guess .
Good to know I’m not alone with the experience.


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
I am not having the issue over here
https://www.ubbcentral.com/forums/ubbthreads.php/topics/264691/active-text


current active text for Central is the following -
[Linked Image]


as posted, the original is -
[Linked Image]


with active text enabled -
[Linked Image]

note: stock UBB.threads 7.7.5 on PHP 7.1


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Hi Isaac, Thanks for the test. however your test does not test the problem I have been trying to point out.

Based on your info above with UBBCentrals active text see my test of the the last link t h e s q u a r e

look at this

POINTY
https://www.thesquare.com
https://www.POINTY.com/example.jpg

The above came from this
[Linked Image]

The faulty result should look like this and it does,
[Linked Image]

The last link with the example.jpg image url is broken.
In this case it is the word t h e s q u a r e in the url that brakes the url.

Let me know what you think.
Thanks

Last edited by Morgan; 03/02/2021 10:43 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
More info:
Apparantly the issue was addressed a long time ago in Oct 2014, Maybe the bug fix back then didn't work out as planned.
see

https://ubbwiki.com/wiki/view/37/ubb-threads-v7-1-1-changelog.html

9th bullet point under "Bug Fixes"

Fixed a bug with the Active Text featuring causing problems when the text fell within image tags.

Maybe this could be a lead


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Here is another test also including more links.
I used this text in the body, see image
[Linked Image]

The result became this

1, one word
POINTY
2 word in link
https://www.POINTY-test.com/testing
3 word in image link
https://www.POINTY.com/example.jpg
4 image in img ubbcode
[Linked Image from <a href='http://www.EXAMPLE.com/POINTY'>POINTY</a>.com]
5 Image within img and a URL
[Linked Image from thesquare.com]
6 URL 6
https://www.POINTY.com/example.jpg
7 URL 7
this is a link to the image thesquare
8 URL 8
Check this image

Result= 2, 3, 4 and 6 are corrupted with broken links

Last edited by Morgan; 03/05/2021 6:20 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Hi Isaac, I'm interested to know if my example above did shine some light on the topic?
Quote
Result= 2, 3, 4 and 6 are corrupted with broken links

Thanks


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,289
Likes: 115
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,289
Likes: 115
This will be worked on in the future as time permits; as of this thread is just one user posting repeatedly I am locking it until it can be worked on and looked into further by the development team.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Forum Privacy Policy
by ECNet - 02/26/2024 11:58 AM
Who's Online Now
2 members (Geoff, domspeak), 353 guests, and 190 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)