|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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#Post840886Could 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.jpgneither 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 1:14 PM.
|
|
|
|
Joined: Jun 2006
Posts: 16,373 Likes: 129
|
Joined: Jun 2006
Posts: 16,373 Likes: 129 |
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".
|
1 member likes this:
isaac |
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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 4:28 PM.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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>
|
|
|
|
Joined: Jun 2006
Posts: 16,373 Likes: 129
|
Joined: Jun 2006
Posts: 16,373 Likes: 129 |
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.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
Here is a test I did https://www.britbike.com/forums/ubbthreads.php/topics/841074/testing-active-link#Post841074I 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.gifSee 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 5:03 AM.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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.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: we're instructing PHP to replace all matches within the post body. The member's comment is 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: 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 5:52 PM.
|
|
|
|
Joined: Apr 2004
Posts: 1,983 Likes: 158
|
Joined: Apr 2004
Posts: 1,983 Likes: 158 |
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.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
Thanks Isaac I sure appreciate that you’ll look into this.
|
1 member likes this:
isaac |
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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" ???
|
|
|
|
Joined: Apr 2004
Posts: 1,983 Likes: 158
|
Joined: Apr 2004
Posts: 1,983 Likes: 158 |
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.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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 9:05 AM.
|
|
|
|
Joined: Apr 2004
Posts: 1,983 Likes: 158
|
Joined: Apr 2004
Posts: 1,983 Likes: 158 |
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. 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
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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#Post841074The 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 The result became this, what you don't see is that the urls are corrupted. 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. 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 basisHenrys 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. Thanks for your help you know I love you all. PS If I am totally wrong you can absolutely delete the thread.
Last edited by Morgan; 03/01/2021 11:25 AM.
|
|
|
|
Joined: Dec 2003
Posts: 6,633 Likes: 85
|
Joined: Dec 2003
Posts: 6,633 Likes: 85 |
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: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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 POINTYhttps://www.thesquare.comhttps://www.POINTY.com/example.jpgThe above came from this The faulty result should look like this and it does, 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 9:43 AM.
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
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.html9th 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
|
|
|
|
Joined: Jun 2006
Posts: 999 Likes: 26
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 999 Likes: 26 |
Hi Isaac, I'm interested to know if my example above did shine some light on the topic? Result= 2, 3, 4 and 6 are corrupted with broken links Thanks
|
|
|
|
Joined: Jun 2006
Posts: 16,373 Likes: 129
|
Joined: Jun 2006
Posts: 16,373 Likes: 129 |
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.
|
|
|
1 members (Larry Miller),
102
guests, and
160
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|