vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Word Links (Turn words into links) by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=263700)

BirdOPrey5 01-12-2013 02:07 PM

I don't have data to compare. I've seen several hundred links work without issue.

RSNF 01-04-2014 11:41 PM

Is there a way to get this to ignore anything in a BB tag?

mdawg 04-03-2015 04:52 AM

How about making this for vb 5 - vb5 is the wave of the future!

I was stuck in vb3 for years but now that I've upgraded to vb5 over all I am glad I made the move.

BirdOPrey5 04-03-2015 07:37 PM

Quote:

Originally Posted by RSNF (Post 2472298)
Is there a way to get this to ignore anything in a BB tag?

Not really, it never sees the bbcodes, it works on the test that had already been converted to HTML.

BirdOPrey5 04-03-2015 07:38 PM

Quote:

Originally Posted by mdawg (Post 2542229)
How about making this for vb 5 - vb5 is the wave of the future!

I was stuck in vb3 for years but now that I've upgraded to vb5 over all I am glad I made the move.

I have done some work on a VB5 version, it is not out of the question.

NeutralizeR 04-06-2016 08:24 AM

Hello,

Thanks for the mod. It seems I need a custom regex for this. Matching the <i> tags.

I also noticed if I use Turkish characters such as "Ş" in the phrase, the HTML output becomes invalid and I see the post text as font=5 ... etc.

NeutralizeR 04-06-2016 10:33 PM

Changing
PHP Code:

$bopfind preg_quote(htmlspecialchars($bopfind)); 

to
PHP Code:

$bopfind preg_quote($bopfind); 

fixed the issue with Turkish characters but not sure If it is safe to remove htmlspecialchars though I won't use &amp; < > etc. in my phrases.

<b> <i> <a> format has problems

BirdOPrey5 04-07-2016 07:14 AM

Sorry, am not able to test or fix it for non-English characters.

Removing htmlspecialcharacters may be causing the issue with the tags, but if you want to try a new custom regex try:

Code:

</b></a>|</font></a>|</b></font></a>|</font></b></a>|</c>|</b>|</i>|</a>|
However I don't know if it will work.

The default to go back to if it doesn't work is:

Code:

</b></a>|</font></a>|</b></font></a>|</font></b></a>|</c>|

NeutralizeR 04-07-2016 09:11 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2568608)
Sorry, am not able to test or fix it for non-English characters.

Removing htmlspecialcharacters may be causing the issue with the tags, but if you want to try a new custom regex try:

Code:

</b></a>|</font></a>|</b></font></a>|</font></b></a>|</c>|</b>|</i>|</a>|
However I don't know if it will work.

The default to go back to if it doesn't work is:

Code:

</b></a>|</font></a>|</b></font></a>|</font></b></a>|</c>|

Thanks, It worked. Not sure what "</c>" stands for though...

I fixed the problem with Turkish characters.

Added this function:

PHP Code:

function bop5htmlspecialchars ($t){   $find[0] = '<';   $find[1] = '>';   $replace[0] = '&lt;';   $replace[1] = '&gt;';   return str_replace ($find$replace$t);} 

Replaced the related line with this:
PHP Code:

$bopfind preg_quote(bop5htmlspecialchars($bopfind)); 

And replaced the $bopwd with this in the regex:
PHP Code:

(?<=^|\PL)('.$bopfind.')(?=\PL|$) 

Now "Match Whole Words Only" works for words beginning and ending with Turkish characters.

I'm currently using the CSV file and I will have about 200-250 words when I am done with the full list. xCache and VB Optimise are enabled, did not notice any performance issues so far (with 57 words). Do you think using the admincp option is faster?

BirdOPrey5 04-07-2016 10:59 AM

I don't think it would be a noticeable difference. In theory I suppose the admincp option would be slightly faster but also require slightly more memory use on every page load regardless if word links were being used on the page or not.

The setting was never meant to be faster than the other, juset easier for people dealing with longer lists of keywords/links.


All times are GMT. The time now is 09:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01244 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete