vb.org Archive

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

naisho 12-04-2014 06:28 AM

After upgrading to php 5.4 the mod doesn't work any more.
I get this at the beginning of each post (or cms article).
I am using the Gold version of the mod.
Any advice to fix this?

Quote:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">span class="boplink">The text

Marv 12-04-2014 07:27 AM

Quote:

Originally Posted by ozzy47 (Post 2525486)
Ummm, not sure, as this is BOP's mod not mine. :)

Ermmmm....*gnarf*.. I should read before I write. All credits to BirdofPrey ;)

postcd 12-17-2014 02:40 PM

Hi,

please how can i add an ěščřž???? characters (ISO-8859-2) into word replacement wordlinks file?

I tried as it is, html entities and unicode converted text. but none works to show replacement only text without diacritics is ok..

please how to fix it? Thank you

postcd 12-17-2014 03:39 PM

Quote:

Originally Posted by nektar (Post 2500882)
As of php 5.4 default encoding for htmlspecialchars is UTF-8.
So if your forum is in another encoding (like ISO-8859-1 which is mine) then you will have all the above problems.
The solution is to use your encoding with htmlspecialchar:

I tried this but im getting error when i use: ISO-8859-2


Warning: htmlspecialchars() [function.htmlspecialchars]: charset `ISO-8859-2' not supported, assuming iso-8859-1 in [path]/includes/functions_bop_wordlinks.php on line 123

iso-8859-1 dont show-up links for me

naisho 12-21-2014 09:11 AM

The solution given by nektar worked fine for me.
In functions_bop_wordlinks.php file, I did that (around line 121):

Code:

//    $bopfind = preg_quote (htmlspecialchars($bopfind));
      define('CHARSET', 'ISO-8859-1');
      define('REPLACE_FLAGS', ENT_COMPAT | ENT_XHTML); 
      $bopfind = preg_quote (htmlspecialchars($bopfind,REPLACE_FLAGS, CHARSET));


boffin_adi 03-10-2015 10:17 PM

I have rebuld the cpanel and restore the complete data of the site. And now the process is complete but now i recived this message when i Enable Word Links FREE by BOP5 VB4

"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 207502281 bytes) in /home/public_html/includes/class_postbit.php(340) : eval()'d code on line 117"

BirdOPrey5 03-10-2015 10:29 PM

How many words do you have setup? If itis hundreds (or more) it may be too much for your server to handle.

If you only have a few it could be something too short it's being matched too often or maybe you have an unbalanced number of keywords vs links?

Try removing all your keywords and links and replacing with just one keyword/link and see if you get the same error.

boffin_adi 03-10-2015 11:41 PM

I Use sample_wordlinks_data.csv and one Words/Phrases To Link and one link still i have problem
And i also try remove all Words and link still i have problem

ForceHSS 03-11-2015 01:21 AM

Quote:

Originally Posted by boffin_adi (Post 2540078)
I Use sample_wordlinks_data.csv and one Words/Phrases To Link and one link still i have problem
And i also try remove all Words and link still i have problem

In this post you made about your problem you posted in vb5 but this plugin is for vb4 so either you posted in the wrong section but if you are running vb5 then this plugin will not work for vb5 as its for vb4 so remove it would be your best option

boffin_adi 03-11-2015 01:36 AM

Sorry for i have posting wrong section, but i use Vb4

postcd 03-11-2015 07:34 AM

Quote:

Originally Posted by postcd (Post 2527685)
im getting error when i use: ISO-8859-2

Warning: htmlspecialchars() [function.htmlspecialchars]: charset `ISO-8859-2' not supported, assuming iso-8859-1 in [path]/includes/functions_bop_wordlinks.php on line 123

iso-8859-1 dont show-up links for me

im using ěščřž???? chars..

i found ISO-8859-2 is not supported in htmlspecialchars() function: http://php.net/manual/en/function.htmlspecialchars.php

Please any idea how to replace (htmlentities?) that function or safelly skip it so this Word Links plugin works with that charset?

functions_bop_wordlinks.php CODE:
Code:

//    $bopfind = preg_quote (htmlspecialchars($bopfind));
      define('CHARSET', 'ISO-8859-2');
      define('REPLACE_FLAGS', ENT_COMPAT | ENT_XHTML); 
      $bopfind = preg_quote (htmlspecialchars($bopfind,REPLACE_FLAGS, CHARSET));

iso-8859-1 dont show-up links for me

ForceHSS 03-11-2015 09:13 AM

Talk to your host

BirdOPrey5 03-11-2015 11:51 AM

Quote:

Originally Posted by postcd (Post 2540110)
im using ě?čř????? chars..

i found ISO-8859-2 is not supported in htmlspecialchars() function: http://php.net/manual/en/function.htmlspecialchars.php

Please any idea how to replace (htmlentities?) that function or safelly skip it so this Word Links plugin works with that charset?

functions_bop_wordlinks.php CODE:
Code:

//    $bopfind = preg_quote (htmlspecialchars($bopfind));
      define('CHARSET', 'ISO-8859-2');
      define('REPLACE_FLAGS', ENT_COMPAT | ENT_XHTML); 
      $bopfind = preg_quote (htmlspecialchars($bopfind,REPLACE_FLAGS, CHARSET));

iso-8859-1 dont show-up links for me

I'm sorry I can't support non-latin character sets, I just don't know how they work.

But looking at the description you could just try replacing htmlspecialchars with htmlentities in the code- the function should work the same way,

BirdOPrey5 03-11-2015 11:52 AM

Quote:

Originally Posted by boffin_adi (Post 2540078)
I Use sample_wordlinks_data.csv and one Words/Phrases To Link and one link still i have problem
And i also try remove all Words and link still i have problem

What version of PHP are you running?

john7911 03-11-2015 02:40 PM

Thank you very much
It work fine but I have some problem with this one
https://vborg.vbsupport.ru/showthrea...hlight=hashtag
Can you check please.
Thank you.

BirdOPrey5 03-11-2015 03:06 PM

Quote:

Originally Posted by john7911 (Post 2540143)
Thank you very much
It work fine but I have some problem with this one
https://vborg.vbsupport.ru/showthrea...hlight=hashtag
Can you check please.
Thank you.

OK, htmlentities is not going to work then.

Create a new plugin on the global_bootstrap_init_start hook with an execution order of 3.

Code:

Code:

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

Then in the other plugin replace htmlentities and replace with bop5htmlspecialchars

postcd 03-12-2015 02:33 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2540122)
try replacing htmlspecialchars with htmlentities in the code- the function should work the same way,

well as per htmlentities() description, it do NOT support czech charsets (ISO 8859-2, Windows-1250, UTF-8)
only UTF-8, but im unsure why then links are not added to words when they contain some of ě?čř????? characters.. so there is no way to modiffy

Code:

//    $bopfind = preg_quote (htmlspecialchars($bopfind));
      define('CHARSET', 'ISO-8859-2');
      define('REPLACE_FLAGS', ENT_COMPAT | ENT_XHTML); 
      $bopfind = preg_quote (htmlspecialchars($bopfind,REPLACE_FLAGS, CHARSET));

or any other part of the code so it work?

BirdOPrey5 03-13-2015 01:22 PM

I'm afraid as I said earlier I am not able to support non-English languages, sorry, I just don't know how PHP works when not using the letters I am familiar with. Maybe someone else had an idea.

john7911 03-13-2015 07:44 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2540144)
OK, htmlentities is not going to work then.

Create a new plugin on the global_bootstrap_init_start hook with an execution order of 3.

Code:

Code:

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

Then in the other plugin replace htmlentities and replace with bop5htmlspecialchars

Thank you ;)

Emad ELsayed 03-16-2015 06:07 PM

dear
Does not work on the vBulletin 4.2.3 Beta 4 version
The problem: White page when open any Post

BirdOPrey5 03-16-2015 07:49 PM

<a href="http://www.qapla.com/mods/showthread.php/1189-Word-Links-Test" target="_blank">I use it on my site on 4.2.3 beta 4</a>, so if you are getting white pages there is some other problem.

Check your PHP Error Log for an actual error.

Emad ELsayed 03-22-2015 06:05 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2540640)
I use it on my site on 4.2.3 beta 4, so if you are getting white pages there is some other problem.

Check your PHP Error Log for an actual error.

dear
I apologize for the delayed response
There is no error in php
I am puzzled by it

Emad ELsayed 03-23-2015 05:03 PM

Hello dear
These are mistakes error_log file
PHP Code:

[23-Mar-2015 17:55:13 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 51073207 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:15 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 55905051 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:15 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 106391005 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:15 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 103884673 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:21 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 32761041 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:22 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 104046532 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:25 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 52416700 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:25 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 41854895 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:26 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 93903556 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:30 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 57345636 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:30 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 68756069 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:30 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 53159946 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:32 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 42914149 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:34 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 48537547 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:34 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 55637413 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:36 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 54278860 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:37 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 49254027 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 17:55:38 UTCPHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 107082729 bytesin /home/myfourm/public_html/vb/includes/functions_bop_wordlinks.php on line 135 


BirdOPrey5 03-23-2015 05:06 PM

Your PHP Memory Limit is fairly small for VB4. You or your host should increase it to 128M.

(That would be 128 Mega Bytes.)

Emad ELsayed 03-23-2015 06:24 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2541310)
Your PHP Memory Limit is fairly small for VB4. You or your host should increase it to 128M.

(That would be 128 Mega Bytes.)

The increase PHP Memory Limit to 128 MB

But the same problem

Look

Quote:

[23-Mar-2015 19:16:32 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 78990086 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:33 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 113092310 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:36 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 169837257 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:36 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 113092310 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:37 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 74817363 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:41 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 84332086 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:45 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 153219790 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:51 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 75848469 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:52 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 172037001 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:53 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 115640500 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:54 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 86630631 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:16:56 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 127397005 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135
[23-Mar-2015 19:17:01 UTC] PHP Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to allocate 217914582 bytes) in /home/myforum/public_html/vb/includes/functions_bop_wordlinks.php on line 135

BirdOPrey5 03-24-2015 02:02 PM

How many keywords and links do you have? Can you paste the keywords here? If not, can you PM them to me?

Emad ELsayed 03-24-2015 08:16 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2541379)
How many keywords and links do you have? Can you paste the keywords here? If not, can you PM them to me?

Dear hack it works without a problem before the upgrade to version 4.2.3 Beta 4

BirdOPrey5 03-25-2015 09:56 AM

Please answer the question. If you have 5,000 keywords/links or 5 keywords/links or something in between I need to know what I'm dealing with.

Did you upgrade PHP or anything else when you upgraded to 4.2.3 Beta 4?
What version of VB was it working on for you?
What version of PHP are you using now?

Emad ELsayed 03-25-2015 12:18 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2541461)
Please answer the question. If you have 5,000 keywords/links or 5 keywords/links or something in between I need to know what I'm dealing with.

Did you upgrade PHP or anything else when you upgraded to 4.2.3 Beta 4?
Yes dear i update the php version 4.5.38

You upgrade in PHP version 4.5.38 and issued in MySQL 5.5.37-cll

What version of VB was it working on for you?
4.2.2

What version of PHP are you using now?
4.5.38

Thank you for your cooperation
Best regards

mdawg 04-03-2015 04:53 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.

mdawg 04-03-2015 01:58 PM

By the way, when I was using vb3 and vbseo, there was a feature in vbseo that did this called "vbSEO acronym expander." But back then vbseo had to modify their code for me so that it worked for HTTPS (not just HTTP) urls.

So I dunno, maybe that is the key to how to address this problem for vb5 too.

In any case, this would be a great mod for vb5 - to allow the changing of select words automatically as they appear in all posts into hyperlinks.

BirdOPrey5 04-03-2015 07:41 PM

We'll see- the way it needs to work in VB5 is a bit different, but I have an early beta working on VB5 already- I may release it at some point if I feel I can get it ready.

mdawg 04-03-2015 09:28 PM

Nice! Thanks. Look forward to it, and any other useful vb5 mods.

addamroy 04-03-2015 10:12 PM

BOP - Is there any way you can do a 'minor' update to this thing so that it never "links to itself"??

IE I'm linking mainly to internal pages with this, and it looks kind of silly when a thread has several links to itself.

What do you think??

BirdOPrey5 04-07-2015 04:18 PM

Quote:

Originally Posted by addamroy (Post 2542309)
BOP - Is there any way you can do a 'minor' update to this thing so that it never "links to itself"??

IE I'm linking mainly to internal pages with this, and it looks kind of silly when a thread has several links to itself.

What do you think??

Wouldn't really be minor... Will consider it, it unfortunately won't be for a while, if it happens.

mdawg 11-22-2015 02:19 PM

Still would like to see this for vb 5.

JesterP 12-10-2015 05:47 PM

Is there a way to tell the parser to disregard a specific post? Like a bbcode or a word that will tell it not to create links for this post.

There are isolated instances where I want the forum the post is in to be enabled, but some posts, maybe not.

Thank you!

Alan_SP 12-11-2015 08:10 AM

Did you try noparse BBcode?

JesterP 12-14-2015 12:21 AM

Quote:

Originally Posted by Alan_SP (Post 2560195)
Did you try noparse BBcode?

Hiya,

No I haven't. I'll see how that works out.

Thanks

*edit* It stopped bbcode from parsing, but the word links continued. Any other ideas?

BirdOPrey5 12-14-2015 08:10 AM

Quote:

Originally Posted by JesterP (Post 2560141)
Is there a way to tell the parser to disregard a specific post? Like a bbcode or a word that will tell it not to create links for this post.

There are isolated instances where I want the forum the post is in to be enabled, but some posts, maybe not.

Thank you!

It's a two step process.

1st in BBCode Manager you need to make a new BBCode... call it nolink or something like that.
Make the replacement:

Code:

<nolink>{param}</nolink>
and save it...


Then you need to edit the Word Links mod settings. At the bottom of the settings the option called Custom Regex

You should have some existing code in this box, at the very end of it, making sure to leave no space, add the following code:
Code:

|</nolink>
And save changes.

And if all works then you should be able to write
Quote:

This [nolink]keyword[/nolink] will not be linked...
in a post and it won't be linked.


All times are GMT. The time now is 04:12 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.01733 seconds
  • Memory Usage 1,912KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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