View Full Version : Show Thread Enhancements - Title Tag Fetcher (Auto Replace URL with Titletag)
exportforce
08-30-2008, 10:00 PM
Hi there.
Since I needed a new URL Autotext Generator, I always loved the prework of Jafo232 (https://vborg.vbsupport.ru/member.php?u=54825) and his Replace URL's With Page Title (https://vborg.vbsupport.ru/showthread.php?t=155909).
I just did some modifications on this Mod and for some forseeing mistypings, I also leaned out the checking of the "www" if given.
For those who don't know that mod it's quite simple:
If you post an URL in the Forums, this Mod just loads the <title>XXXXXX</title> out of the linked website.
The title won't be read if the following conditions occur:
The linked page simply has no <title>-Tag
The page is down or the <title>-Tag is not being found within the first 60 seconds
The <title>-Tag is not being found within the first 1000 lines of code.Installation:
Just import the XML via the ACP and thats all.
Uninstall:
Just kill it out of your ACP.
01.09.2008 Update
Fixed Typo which got us a parse error
ArnyVee
08-31-2008, 06:00 PM
So this is an updated version of the same mod? How does it differ?
exportforce
08-31-2008, 06:07 PM
The difference is just very minor, but needed for my forums.
Some fool around with URL's like the "leet and ubber cool" mixing of caps and lower letters.
So I had to add the different www-Versions with caps and non-caps.
I also added the Check for the VBulletin-Version.
Thats quite it.
bokmade
09-01-2008, 04:16 AM
Any Demo site ..!!
I Don't get the point ..
exportforce
09-01-2008, 06:46 AM
Dunno how to show a demo.
It's quite easy.
If you would post a Link to http://www.vbulletin.org the Script would get in affect.
It would load up the site, get redirected to the portal https://vborg.vbsupport.ru/portal.php (You can manually check that by going to vbulletin.org) and fetch the line
<title>vBulletin.org Forum - The Official vBulletin Resource!</title>
Now it takes the value of the Title-Tag which is "vBulletin.org Forum - The Official vBulletin Resource!" and puts it as automatic text for the link.
So http://www.vbulletin.org would automatically posted as: vBulletin.org Forum - The Official vBulletin Resource! (http://www.vbulletin.org)
Hope that clears things up. :)
KURTZ
09-01-2008, 07:44 AM
i've got and error (parse error) with this hack ... also it seems that isn't compatible with the Passive Vid hack installed ...
edit: Parse error: syntax error, unexpected T_STRING in /home/fniv/domains/fniv.it/xxx/xxx/includes/functions_newpost.php(175) : eval()'d code on line 50
exportforce
09-01-2008, 08:25 AM
Thank you for the note.
Fixed it.
KURTZ
09-01-2008, 08:40 AM
Thank you for the note.
Fixed it.
yes now it's correct ... but with the Passive VID enabled don't run ... can you give me a solution? thx
exportforce
09-01-2008, 08:57 AM
I am sorry, I don't know that Addon, since I create BB-Codes for Youtube and stuff.
Patrick Simmons
09-12-2008, 11:05 AM
yes now it's correct ... but with the Passive VID enabled don't run ... can you give me a solution? thx
Same here :(
JetHaCkR
09-13-2008, 12:21 PM
Nice Job :)
how abount doman name affter the link any idea ???
inciarco
01-03-2009, 11:29 PM
For your next Update, it would be great to have the Option to Select the Links to Convert, like:
Internal Links (the Forum's): Yes/No Option :confused:
External Links (Any Other Web Site): Yes/No Option :confused:
So that the Admin can Choose to Select one, both or none of the Options.
In my case I'd like only to use the Internal Links (for now), but the current Mod Converts Both Internal and External Links to their Titles.
Great Mod, I Hope you can offer those Options to make it more Fleible.
My Best Regards.
:)
Da22Da
01-19-2009, 06:48 PM
anyone installed it on 380 and got it to work?
i know the version check in there up to 4.0 alpha 1 but does not work on 3.8.0 so far
iyama
02-23-2009, 09:11 PM
not working on 3.8.1 . Thnx for in/unstalling and the good job :)
inciarco
02-23-2009, 09:48 PM
How can I Edit the Plugin of this Mod for it Only to be Applied to the Local Links (URLs of my Forums) and Not External Links? :confused:
My Best Regards.
:)
relaxiha
04-01-2009, 11:48 AM
hello
please upgrade to 3.8.2
tunistunis
05-22-2009, 01:48 PM
not working on 3.8.1....
djbaxter
05-22-2009, 02:27 PM
not working on 3.8.1....
It does work on 3.80, 3.81, and 3.82.
bugzy
06-04-2009, 05:34 PM
works pretty good so far
on 3.8.2
cynthetiq
06-20-2009, 06:38 PM
thanks! works with 3.8.3 with AME and another itemstats mod.
MAORBARI
07-26-2009, 09:44 PM
it is dont work to me
i have 3.8.3..
exportforce
07-29-2009, 01:28 PM
Must be a different addon blocking this.
Please try to disable all other addons to check.
HMBeaty
09-11-2009, 09:39 PM
Get an error with this modification on vBulletin 3.8.4 when using quick reply saying the message I have entered is too short. My message was well over my character limit. Works when using advanced reply though
arauf
09-16-2009, 11:14 AM
hi , im using 3.8.4 , and its not fetching the title for me , i mean when i paste the link , it still looks the same ,where im doing wrong ?
arauf
09-27-2009, 07:32 AM
*installed* and working like charm , well , like HMBeauty said , if u use it in advance mode first then it will star workin in quick replay automatically , in VB 3.8.4 , i donu why is that , but thats how i get it worked,
Thanx alot exportforce"for sucha great mod.
exportforce
10-01-2009, 01:32 PM
The thing with quick-edit is nothing related to this mod.
Quick Edit goes "another way" of editing. Other mods, related to edit URLs do the same on my boards.
Audax666
10-08-2009, 03:18 PM
how long did I searched for that and why didn't I found it?
Until today! Many thanks for that.
Installed:up:
One thing I would like to do is to strip the branding in my title tag at the end
Now it's
"This is my title tag...sub-cultures.de" and I would like to remove the "sub-cultures.de" part.
I grant you three wishes if anyone can help me! :D
farazfaraz
02-02-2010, 09:27 AM
احسنت
Cadellin
05-25-2010, 09:35 AM
Anyone know if this works on vb4?
lingstar
07-18-2010, 02:25 PM
Didn't work in my install of VB4 - got:
The following dependencies were not met:
1. This product is not compatible with version 4.0.3 of vBulletin. (Compatible starting with 3.6.0 / Incompatible with 4.0.0 alpha 1 and greater)
Anyone have any mod that will work?
Thanks!
Barb
BirdOPrey5
11-29-2010, 02:09 AM
This actually works just fine on VB4, you just have to edit the XML file to allow it to install.
Download the mod, open the XML file in notepad or another text editor.
Find the line:
<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="4.0.0 alpha 1" />
It will be near the top...
Then simply change the max version to 4.9.9:
<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="4.9.9" />
It will now install and work.
BirdOPrey5
11-30-2010, 12:01 AM
Anyone got this mod playing nicely with AME 2.5 (Automatic Media Embeder) - with both mods enabled the titles of youtube videos become URL's instead of words.
BirdOPrey5
01-17-2011, 01:15 AM
I got this "fixed" - the problem was never with AME, the problem was this mod didn't work on youTube links anyway- because youtube puts line-breaks in their title and this mod couldn't deal with that.
To fix this go to your plugin manger -> edit the "Title Replace" plugin
Find the line:
preg_match("/<title>[\n\r\s]*(.*)[\n\r\s]*<\/title>/", $page, $title);
Replace it with these lines:
preg_match("/<title>[\r\n\s]*([^<>]*)<\/title>/i", $page, $title);
$title = preg_replace ("#[\r\n]#"," ", $title);
This will fix the problem with youtube (line breaks in titles) AND the issue someone else mentioned where captial <TITLE> tags didn't work either.
jbizzle
01-17-2011, 02:02 AM
Thanks for the fix Bird, but I have yet another question. How come when I edit a post and add a URL it does not fetch the new title? It just leaves it as the URL unless its a new post.
BirdOPrey5
01-17-2011, 03:55 AM
yeah I noticed this too. As is the mod only works on "new threads" it doesn't work on edited threads. I will see if I can get it to work on both.
iyama
03-16-2011, 06:17 AM
Is this still working on vb4?
HMBeaty
03-16-2011, 06:44 AM
Is this still working on vb4?
Works for me (vBulletin 4.1.2)
Alfa1
03-16-2011, 01:03 PM
Does this also work for previous posts or only for posts made after installation?
Once this mod is uninstalled, will the links turn back their original state?
BirdOPrey5
03-16-2011, 01:07 PM
Only works on new posts.
Links will never change back.
BirdOPrey5
08-12-2011, 09:50 AM
Still working on 4.1.5 for me. :up:
dalreardon
08-19-2011, 04:56 AM
Hi,
I am trying to find a mod like this one for VB v4.1.5
Someone referred me to this mod but when I tried to import the product I got an error message that said the product was not compatible with v4.1.5 and it wouldn't allow the import.
Any suggestions of a compatible mod?
EDIT - Have now read all the posts above and see how to make it import.
Did you ever get it to work on editing posts?
Thanks,
Dale.
http://www.settledin.com.au
.
http://www.settledin.com.au/tasforum/
.
HMBeaty
08-19-2011, 05:05 AM
Hi,
I am trying to find a mod like this one for VB v4.1.5
Someone referred me to this mod but when I tried to import the product I got an error message that said the product was not compatible with v4.1.5 and it wouldn't allow the import.
Any suggestions of a compatible mod?
Thanks,
Dale.
http://www.settledin.com.au
.
http://www.settledin.com.au/tasforum/
.
Open up the .xml and change:
maxversion="x.x.x"
To:
maxversion=""
It works just fine in 4.1.5 :D
GamerFill
10-12-2011, 03:31 PM
I can confirm that this works in version 4.1.7; I just installed it today.
Make sure you edit the "maxversion" like everyone else said!
HMBeaty
10-12-2011, 03:46 PM
Honestly, there's no reason that this SHOULDN'T work on any version of vBulletin....unless they change the bbcode for some reason :P
As stated in previous posts, you would just need to edit (or remove):
<dependencies>
<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="4.0.0 alpha 1" />
</dependencies>
To work on vBulletin 4
jamunkala1
12-02-2011, 03:08 PM
It works with 4.1.8
Thankyou
Anybody know the plugin which makes you wait for few seconds before taking to external sites
hi, install this product in Vbulletin 4.1.10 and earlier work, but suddenly stopped working and when I changed the title only shows the name of the page.
BirdOPrey5
02-12-2012, 09:53 PM
I noticed in 4.x that is you use the WYSIWYG editor it doesn't work but that is because that editor automatically puts the [url] bbcode around the link before you submit it- so the mod never really gets a chance to change the title since it thinks you have chosen your own title.
I noticed in 4.x that is you use the WYSIWYG editor it doesn't work but that is because that editor automatically puts the [url] bbcode around the link before you submit it- so the mod never really gets a chance to change the title since it thinks you have chosen your own title.
Yes, I noticed that the editor always I have for everyone in the "normal" (not WYSIWYG), another thing, when I put the URL in the title instead of leaving it out is the name of the web : play4trophies therefore think it might be a problem in some settings I have.
want a user to access my forum and check it out?
THX
BirdOPrey5 Since I discovered what the problem is, if users do not get them registered in the permissions can not view the contents of the issues this product just substitute the name will link to the web, so that functions properly unregistered users should be able view the contents of the issues, and could change that, that part of the code should be modified?
by the way, you speak Spanish?
BirdOPrey5
02-13-2012, 11:13 AM
I do not speak spanish and honestly I am having trouble following your English.
If you're saying the title isn't being displayed when they link to a page that you have to be registered to view, there is no fix for this- the request to view the page is coming from your sever not from the user making the post so your server will always be a guest since it cannot login to any site.
I suppose, and I'm just thinking out loud here, if it's your own site (internal linking) you could create some sort of mod that automatically puts the IP address of your server into a different usergroup so your system doesn't have to login but that is a serious undertaking- not 100% sure it's possible.
First, I apologize for my horrible English, I use a translator to communicate.
I understand what you say, but could not edit anything to make it work?
If you can not just thank you, I've helped a lot and I appreciate the effort.
BirdOPrey5
02-14-2012, 12:39 PM
Unfortunately there is no way to do this with a mod...
On VB 3.8.7 I made this manual change to showthread.php
Find this code:
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($thread['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
{
print_no_permission();
}
Replace with:
//Customer perm override for title tag grabber
if ($_SERVER["REMOTE_ADDR"] == "999.999.999.999")
{
//Do nothing
}
else
{
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($thread['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
{
print_no_permission();
}
} // Cust perm override end if
Replace 999.999.999.999 with the ip address of your web server. (You can "ping" your website domain to get your server ip address)
Note however that it is possible for a hacker to "fake" their IP address and gain access to your hidden threads via this method.
I only use it for threads any registered user can see, they are only hidden from guests on my forum so it works for me.
Unfortunately there is no way to do this with a mod...
On VB 3.8.7 I made this manual change to showthread.php
Find this code:
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($thread['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
{
print_no_permission();
}
Replace with:
//Customer perm override for title tag grabber
if ($_SERVER["REMOTE_ADDR"] == "999.999.999.999")
{
//Do nothing
}
else
{
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($thread['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
{
print_no_permission();
}
} // Cust perm override end if
Replace 999.999.999.999 with the ip address of your web server. (You can "ping" your website domain to get your server ip address)
Note however that it is possible for a hacker to "fake" their IP address and gain access to your hidden threads via this method.
I only use it for threads any registered user can see, they are only hidden from guests on my forum so it works for me.
thanks my Friend.
I sent a PM to let you know a project that came to my head to see if it's easy to do and, if possible.
ss@solidsignal
05-11-2012, 02:25 PM
I would like to auto-bold the title. Is there a way to do that?
BirdOPrey5
05-11-2012, 02:44 PM
Edit the plugin for this product-
Find the line:
return " . $text[4] . "\"]" . preg_replace("/\&.+\;/", '', $title[1]) . " (\"" . $text[2)";
And change it to:
return " . $text[4] . "\"]" . preg_replace("/\&.+\;/", '', $title[1]) . " (\"" . $text[2)";
ss@solidsignal
05-11-2012, 02:51 PM
Thanks. BTW your plugins are awesome, BOP5.
Emeralda
05-27-2012, 02:13 PM
https://vborg.vbsupport.ru/
Jafo's version worked with 4.x though.
BirdOPrey5
05-27-2012, 03:02 PM
http://img444.imageshack.us/img444/1233/8cd0c7712c51470681600ae.png
Jafo's version worked with 4.x though.
Open the product .xml file in a text editor. Near the top somewhere you will see max_version or something like that... change it to 5.0.0. And then install.
infnity8x3
10-02-2012, 08:37 PM
Any way to add urls for this mod to ignore? for example facebook comes back as Update Your Browser | Facebook
So would like to just ignore facebook and other urls that i find to be incompatible
BirdOPrey5
10-02-2012, 09:21 PM
Any way to add urls for this mod to ignore? for example facebook comes back as
So would like to just ignore facebook and other urls that i find to be incompatible
I haven't tested this but you can try-
In the plugin for this mod find the line:
return " . $text[4] . "\"]" . preg_replace("/\&.+\;/", '', $title[1]) . " (\"" . $text[2)";
And replace it with the following:
$fullurl = $text[2].$text[4];
$baddomains = array ('facebook.com',
'wikipedia.com',
'microsoft.com' );
foreach ($baddomains AS $thisbad)
{
if (stripos('x'.$fullurl, $thisbad) //If the bad domain is found in the URL
return "" .$fullurl . " (\"" . $fullurl . "\")";
}
//If we get this far it's not a bad domain...
return "" . preg_replace("/\&.+\;/", '', $title[1]) . " (\"" . $fullurl . "\")";
And obviously you add or remove domain names by making sure they are between single quotes with a comma between each, like facebook.com, wikipedia.com, and microsoft.com in the example. No idea if those are really bad domains or not. I've had trouble with Wikipedia in the past.
infnity8x3
10-02-2012, 09:50 PM
I get this error when posting, but thank you so much for working on this.
Parse error: syntax error, unexpected T_RETURN in /home/rjerick/public_html/mpbp/forum/includes/functions_newpost.php(199) : eval()'d code on line 69
I really want to get this working because i would also love to ignore urls that AME wants to handle.
Edit
fixed it, Just a little oversite.
if (stripos('x'.$fullurl, $thisbad)
was missing and extra ) at the end, should be
if (stripos('x'.$fullurl, $thisbad))
So thank you very much for this mod to a mod :) it works great!
Mr_Running
10-12-2012, 04:09 PM
changed the maxversion="4.3.9
While importing product on 4.2 received this ... Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in [path]/includes/class_core.php on line 724 ??
BirdOPrey5
10-12-2012, 04:36 PM
Can you import any other product? This looks like an error with your product system not this specific product.
Mr_Running
10-13-2012, 01:14 AM
Yes, I can import other products without any warnings.
Everything so far seems to be working even with the warning after importing this mod. I will post back if there is any change.
Evoklub
11-11-2012, 07:08 AM
During install, I got this message:
https://vborg.vbsupport.ru/external/2015/04/31.png
After that, install is successfull, but the mod doesn't work.
Can you help me?
New Joe
06-30-2013, 11:52 PM
Certain urls give time outs when posting with using this mod on vb4
Most of the time it's ok
anyone know of a fix?
kehindelawal
07-05-2014, 10:47 PM
IS this working with vb 5?
ozzy47
07-05-2014, 10:49 PM
IS this working with vb 5?
This would have to be rewritten for vB5
BirdOPrey5
07-06-2014, 05:53 PM
IS this working with vb 5?
This would have to be rewritten for vB5
It's not related to this version but it does the same thing for VB5: https://vborg.vbsupport.ru/showthread.php?t=288954
MaXimus
08-15-2014, 01:03 PM
does this work with vb 3.8.8?
ozzy47
08-15-2014, 01:20 PM
Yes it should.
MaXimus
08-15-2014, 02:26 PM
I imported it into my vb 3.8.8 forum and it DID work
but the moment I imported it I got some mysql error which was too quick for me to even see to copy/paste here :(
ozzy47
08-15-2014, 03:40 PM
I imported it into my vb 3.8.8 forum and it DID work
but the moment I imported it I got some mysql error which was too quick for me to even see to copy/paste here :(
As long as the mod works, and you get no other errors, I would not worry to much about it.
darnoldy
08-21-2014, 02:14 PM
I have opened up the xml file in a text editor. I can't say that I fully understood the codeĀi'm not very fluent in php.
However, I assume that this script could be modified to also get the open graph meta data and display that within a post?
GigaSb
04-05-2015, 05:58 PM
During install, I got this message:
https://vborg.vbsupport.ru/external/2015/04/31.png
After that, install is successfull, but the mod doesn't work.
Can you help me?
got this error too, any chance to get help ?
Darkman7030
05-03-2015, 10:09 AM
true it is also possible to thread title display instead Title Tag?
BirdOPrey5
09-04-2015, 04:48 PM
If you upgrade to higher versions of PHP after upgrading to VB 3.8.9 and find this mod is causing deprecation warnings edit the Title_Replace plugin in plugin manager.
Find the code (at the very bottom):
$messagetext = preg_replace(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siUe',
"convert_url_to_bbcode_callback_auto_title('\\3', '\\1')",
$messagetext
);
And replace it with:
$messagetext = preg_replace_callback(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')\]|$))#siU',
function ($matches)
{
return convert_url_to_bbcode_callback_auto_title($matches[3], $matches[1]);
},
$messagetext
);
And save changes.
That should resolve the issue.
XenonKilla
09-05-2015, 06:34 AM
After I PM'd you and didn't get a response I had someone else look into this issue. This is the code they came up with...
$messagetext = preg_replace_callback(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')\]|$))#siU',
function ($matches)
{
return convert_url_to_bbcode_callback_auto_title($matches[3], $matches[1]);
},
$messagetext
);
I haven't tested your code but I know for certain that the one above works as I'm currently using it in a production environment.
Looks like the same code to me just a different variable name correct?
BirdOPrey5
09-06-2015, 09:01 AM
Probably, I know my code works, if you're sure the other code works that is fine too.
"My code" by the way is virtually the same code from the VB 3.8.9 source code, which I believe the original bit of code it replaces was copied from earlier 3.x source code.
Next time if you do PM me for help and find the answer please let me know so I don't waste time working on something you no longer need.
mdawg
04-13-2016, 05:30 PM
Will this work in vb 4.2.3 has anyone tried it?
djbaxter
04-13-2016, 08:06 PM
Yes it works in 4.2.3
mdawg
04-14-2016, 03:04 AM
When I try to import the xml, I get this error:
The following dependencies were not met:
This product is not compatible with version 4.2.3 of vBulletin. (Compatible starting with 3.6.0 / Incompatible with 4.0.0 alpha 1 and greater).
By the way I am running PHP 5.5 on that server, does that matter?
MarkFL
04-14-2016, 03:30 AM
Open the product .XML file, and near the top you will find a section something like:
<dependencies>
<dependency dependencytype="vbulletin" minversion="4.0.0" maxversion="5.0.0" />
</dependencies>
Change the maxversion to 5.0.0, and then try importing it again. :)
mdawg
04-14-2016, 04:42 PM
Like a charm! it voiks.
One thing I noticed that is that on the old posts, simply editing/saving does not force the mod to convert the URL to external title - must click to edit post, cut out the URL, post it in a web browser, copy it again, and re-post it.
BirdOPrey5
04-15-2016, 11:29 AM
Like a charm! it voiks.
One thing I noticed that is that on the old posts, simply editing/saving does not force the mod to convert the URL to external title - must click to edit post, cut out the URL, post it in a web browser, copy it again, and re-post it.
Might just need to add an extra line or character to the post so the cache is updated.
However if code is already:
www.google.com (http://www.google.com) it will not fetch b/c it already has a title.
Code needs to be http://www.google.com or just www.google.com for it to work.
mdawg
04-16-2016, 05:59 PM
It has something to do with that if the URL has already become a hyperlink, the mod does not recognize it. So after I click to edit a post, I cut out the URL (hyperlink), post it in a browser, then re-post it back into the post in a form where it is no longer a hyperlink and then save it. Then the mod recognizes it and converts to an external title.
Perhaps this is exactly what you are saying in a less technical manner; I don't know.
webnsn
06-29-2016, 09:01 AM
HI
I have added and updated to my Mobile site
Demo - www.wikinewforum.com
cellarius
12-01-2016, 05:58 PM
Hope I did not miss it and this has already been noted somewhere: Should you have any issues with non-standard characters and character encoding (as I did in my German language forum with ???? and the like), this may be of use to you:
In the plugin "Title_Replace" at hook "url_to_bbcode"
find:
return " . $text[4] . "\"]" . preg_replace("/\&.+\;/", '', $title[1]) . " (\"" . $text[2)";
add before:
$title[1] = utf8_decode($title[1]);
Simple, but effective ;)
Avimelech
01-01-2017, 03:13 PM
I'm not getting this to work on 4.2.3 Patch Level 2. Links included in posts just show up normally with the URL and ellipses. (I have included all the mods in the thread.)
I also tried the ZIP version (with the maxversion change alone) and no dice.
Any advice?
BirdOPrey5
01-02-2017, 09:26 AM
Anything in your PHP Error Log?
Avimelech
01-08-2017, 03:05 PM
No errors. (Only from my Wordpress install which is gone.) So I reset the log, did a new post with a link to be processed and no errors in the log still.
Anything else to check?
To reconfirm, you're saying this positively works on the latest 4.2.3 version? Are you running this there?
Also can you confirm that the current ZIP version is all I need or are we talking about modifying it based on the comments since the ZIP?
BirdOPrey5
01-11-2017, 11:42 AM
I'm not saying any of that, I simply asked if there was anything in the error log. What version of PHP are you using?
Avimelech
01-11-2017, 05:50 PM
I'm on PowWeb: Current Default version of PHP: 5.6
djbaxter
01-11-2017, 05:57 PM
It's still working for me on vB 4.2.3 with PHP 5.5.34
As far as I know, vB4 isn't certified above PHP 5.5.x yet, is it?
Avimelech
01-11-2017, 06:56 PM
My PowWeb panel lets me pick my PHP version: 5.3, 5.5, or 5.6. Should I bump it down to 5.5 and report back?
MarkFL
01-11-2017, 07:02 PM
My PowWeb panel lets me pick my PHP version: 5.3, 5.5, or 5.6. Should I bump it down to 5.5 and report back?
THe minimum requirements for vB 4.2.3 are:
vBulletin 4.2.3 requires PHP 5.4.0+ and MySQL 4.1.0+.
As far as I know, you should be fine with PHP 5.6.x and vB 4.2.3. :)
Paul M
01-11-2017, 08:48 PM
Given this was written for vB3.7 (and probably PHP 5.2 or even 5.1) its not going to be much of a surprise if it doesnt work properly on 4.2.3 and PHP 5.5 or 5.6.
Rhodium
01-11-2017, 09:14 PM
I'm not getting this to work on 4.2.3 Patch Level 2. Links included in posts just show up normally with the URL and ellipses. (I have included all the mods in the thread.)
I also tried the ZIP version (with the maxversion change alone) and no dice.
Any advice?
Look if you have fopen enabled in php config, it's needed in this addon.
Avimelech
01-12-2017, 08:06 AM
THANK YOU, Rhodium! It did not matter which PHP version I used, all worked once I set allow_url_fopen = On
Kane@airrifle
01-28-2017, 07:55 AM
This mod has the effect of recording your own server as a guest on your forum which results in some odd behaviour such as listing your server in WOL and not having the ability to tag forum urls where guests do not have viewing permissions.
So, is this expected behaviour; should the code be modified to get around it? If so, how?
mdawg
05-07-2017, 05:12 PM
Yes, correct Rhodium, must have
PHP set for
allow_url_fopen = On
This mod is running okay now, once I made that PHP adjustment, in my 4.2.3 forum running PHP 5.6.30
Note: for any URLs that were not converted (during a period when you had allow_url_fopen = Off ), you must go back in and edit those posts AND remove the hyperlinks from the non-coverted URLs before re-saving the posts. Easiest way to do this is:
1. Click, Edit Post
2. Cut the URL that has not been converted
3. Paste it into a new browser window
4. Copy that URL that has been posted in that browser window
5. Paste the URL back into the post.
6. Save
https://vborg.vbsupport.ru/showpost.php?p=2569103&postcount=87
Now the mod will have created the title for the post. For some reason, edit and save does nothing unless you remove the hyperlink from the URL in question (one that has not been converted).
mdawg
05-12-2017, 02:33 AM
This mod will not work with vb 4.2.5 IF running php 7. It will work under PhP 5.6
Quick replies while running this mod in php 7, go blank.
Kane@airrifle
05-12-2017, 03:42 AM
Running fine for me with 4.2.5 on PHP 7.1.
mdawg
05-12-2017, 04:02 AM
Have you made posts? Or threads? New ones I mean? Then try making a QUICK REPLY to the post, within the thread. Then try an Advanced Reply to the post, within the thread.
Also, I have a phpinfo.php file loaded in my directory to verify which exact version of PhP I am running, and an .htaccess file that was forcing PhP 5.6 for this directory only, for my vb4 forum only. I commented out the code in that .htaccess to revert to PhP 7, and that was when I determined these issues with this mod.
Issues I had were with PhP 7.0.18 if that makes a difference.
Kane@airrifle
05-12-2017, 11:49 AM
Have you made posts? Or threads? New ones I mean? Then try making a QUICK REPLY to the post, within the thread. Then try an Advanced Reply to the post, within the thread.
Issues I had were with PhP 7.0.18 if that makes a difference.
Yes; result below:
New Thread Test
Show Thread Enhancements - Title Tag Fetcher (Auto Replace URL with Titletag) - Page 7 - vBulletin.org Forum (https://vborg.vbsupport.ru/showthread.php?p=2586410#post2586410)
No parse BBcode
[noparse]https://vborg.vbsupport.ru/showthread.php?p=2586410#post2586410
Quick Reply:
Show Thread Enhancements - Title Tag Fetcher (Auto Replace URL with Titletag) - Page 7 - vBulletin.org Forum (https://vborg.vbsupport.ru/showthread.php?p=2586410#post2586410)
mdawg
05-12-2017, 12:41 PM
I don't know what your post above means. The URLs just direct me back to my own post within this thread. I meant, have you done that within your own vb4 forum that verifiably is running PhP 7 (such as verified with a phpinfo.pho file) and with this mod running.
djbaxter
05-12-2017, 12:51 PM
It means it does work with PHP 7.1.
He's showing you examples: the notification email shows that he entered URLs and his post above demonstrates that they were converted to titles.
mdawg
05-13-2017, 12:44 AM
Well for whatever reasons, when I toggle this mod here, and this other mod (Automatic Tagger)
https://vborg.vbsupport.ru/showpost.php?p=2586407&postcount=459
on and off, my vb 4 php 7 forum has issues, namely that posts made are invisible other than at most the title of a post on an advanced reply, and the issues go away when I disable those two mods.
These are the PhP errors from the error_log :
-May-2017 19:51:40 America/Los_Angeles] PHP Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/*****/public_html/*****.com/forums/includes/class_core.php on line 1424
[12-May-2017 19:54:32 America/Los_Angeles] PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/*****/public_html/*****.com/forums/includes/functions_newpost.php(196) : eval()'d code on line 70
[12-May-2017 19:54:34 America/Los_Angeles] PHP Deprecated: Function split() is deprecated in /home/*****/public_html/*****.com/forums/includes/functions_autotaggerfromcontentandtitle.php on line 85
[12-May-2017 19:56:24 America/Los_Angeles] PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/*****/public_html/*****.com/forums/includes/functions_newpost.php(196) : eval()'d code on line 68
[12-May-2017 19:56:24 America/Los_Angeles] PHP Fatal error: Call to undefined function split() on line 85 in /home/mdawg/public_html/truepassage.com/forums/includes/functions_autotaggerfromcontentandtitle.php
in /home/mdawg/public_html/truepassage.com/forums/vb/vb.php on line 286
[12-May-2017 19:56:24 America/Los_Angeles] PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/mdawg/public_html/truepassage.com/forums/includes/functions_newpost.php(196) : eval()'d code on line 68
Those errors are with both mods running.
With autotagger off, but external title fetcher ON (under php 7):
[12-May-2017 20:08:35 America/Los_Angeles] PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/*****/public_html/*****.com/forums/includes/functions_newpost.php(196) : eval()'d code on line 68
djbaxter
05-13-2017, 01:06 AM
Well for whatever reasons, when I toggle this mod here, and this other mod (Automatic Tagger)
https://vborg.vbsupport.ru/showpost.php?p=2586407&postcount=459
on and off, my vb 4 php 7 forum has issues, namely that posts made are invisible other than at most the title of a post on an advanced reply, and the issues go away when I disable those two mods.
I had conflicts with Automatic Tagger even before vBulletin 4.2.5 and with PHP 5.x.
What happens if you disable that one and keep Title Tag Fetcher installed?
mdawg
05-13-2017, 01:48 AM
I have tried that yes - disabling AutoTagger but leaving this mod, which is the one I care about more, running, but still posts invisible and this PhP error:
With autotagger off, but external title fetcher ON (under php 7):
[12-May-2017 20:08:35 America/Los_Angeles] PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/*****/public_html/*****.com/forums/includes/functions_newpost.php(196) : eval()'d code on line 68
djbaxter
05-13-2017, 02:14 AM
You could try editing the plugin from your AdminCP.
This seems to be what it doesn't like (at the very end of the plugin code - PLUGIN not PRODUCT):
$messagetext = preg_replace(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siUe',
"convert_url_to_bbcode_callback_auto_title('\\3', '\\1')",
$messagetext
);
No idea if this will work or not but you could try replacing that line with
$messagetext = preg_replace_callback(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siUe',
"convert_url_to_bbcode_callback_auto_title('\\3', '\\1')",
$messagetext
);
WARNING: If this breaks your forum and you can't get to your AdminCP, disable hooks so you can edit it back.
mdawg
05-13-2017, 05:03 AM
Do appreciate the help! but it did not solve anything.
When I switched out that code and tested it with PhP 5.6 running, the mod stopped fetching external titles, and the regular URL posted with no conversion to title.
Same result with PhP 7 running, whether I had the other mod (auto tagger), on or off - posts were no longer invisible, but the regular URL posted with no conversion to title.
i.e. the replaced code did eliminate the weird, invisible post behavior, but it also stopped the external title fetcher from fetching external titles, whether in PhP 5.6 or 7.
Rhodium
05-14-2017, 08:16 PM
Try that, works for me
replace
$messagetext = preg_replace(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siUe',
"convert_url_to_bbcode_callback_auto_title('\\3', '\\1')",
$messagetext
);
to
$messagetext = preg_replace_callback(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siU',
function($m) { return convert_url_to_bbcode_callback_auto_title($m[3], $m[1]); },
$messagetext
);
mdawg
05-15-2017, 08:19 PM
Very good! thank you. Now the Title Tag Fetcher (Auto Replace URL with Titletag) mod works at my forum running 4.2.5 with PhP 7 enabled, without making posts invisible.
I wonder if you could take a look at this:
https://vborg.vbsupport.ru/showthread.php?p=2586407#post2586407
for the other mod, Automatic Tagger From Message Content and Title - the issue seems to be similar in that the threads/posts are happening, but error codes interrupt the process.
djbaxter
06-11-2017, 09:02 AM
Try that, works for me
replace
$messagetext = preg_replace(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siUe',
"convert_url_to_bbcode_callback_auto_title('\\3', '\\1')",
$messagetext
);
to
$messagetext = preg_replace_callback(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siU',
function($m) { return convert_url_to_bbcode_callback_auto_title($m[3], $m[1]); },
$messagetext
);
This solves the blank pages problem on vB 4.7.5 with PHP 7.1
However, on two SSL (https://) forums, it no longer fetches the page title, whether the URL being fetched is https:// or http://
This is the entire updated plugin:
if (!function_exists(convert_url_to_bbcode_callback_a uto_title)) {
function convert_url_to_bbcode_callback_auto_title($message text, $prepend)
{
$messagetext = str_replace('\"', '"', $messagetext);
$prepend = str_replace('\"', '"', $prepend);
static $urlSearchArray, $urlReplaceArray, $emailSearchArray, $emailReplaceArray;
if (empty($urlSearchArray))
{
$taglist = '\[b|\[i|\[u|\[left|\[center|\[right|\[indent|\[quote|\[highlight|\[\*' .
'|\[/b|\[/i|\[/u|\[/left|\[/center|\[/right|\[/indent|\[/quote|\[/highlight';
$urlSearchArray = array(
"#(^|(?<=[^_a-z0-9-=\]\"'/@]|(?<=" . $taglist . ")\]))((https?|ftp|gopher|news|telnet)://|www\.)((\[(?!/)|[^\s[^$`\"'|{}<>])+)(?!\[/url|\[/img)(?=[,.!)]*(\)\s|\)$|[\s[]|$))#siU"
);
$urlReplaceArray = array(
"\\2\\4"
);
$emailSearchArray = array(
"/([ \n\r\t])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[^\s]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/si",
"/^([_a-z0-9-]+(\.[_a-z0-9-]+)*@[^\s]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/si"
);
$emailReplaceArray = array(
"\\1\\2",
"\\0"
);
}
$text = preg_replace_callback($urlSearchArray, "auto_title", $messagetext);
if (strpos($text, "@"))
{
$text = preg_replace($emailSearchArray, $emailReplaceArray, $text);
}
return $prepend . $text;
}
function auto_title ($text) {
$options = array( 'http' => array(
'user_agent' => 'VBulletin Titletag Fetcher',
'max_redirects' => 10,
'timeout' => 60,
) );
$context = stream_context_create( $options );
if ($text[2] == 'www.' or $text[2] == 'Www.' or $text[2] == 'wWw.' or $text[2] == 'wwW.' or $text[2] == 'WwW.' or $text[2] == 'WWw.' or $text[2] == 'wWW.' or $text[2] == 'WWW.') { $text[4] = $text[2] . $text[4]; $text[2] = 'http://'; }
$paged = @fopen( $text[2] . $text[4], "r" ); #echo $page . "DONE";
if ($paged) {
while (!feof($paged) and ($x < 1000)) { $page .= fread($paged, 8192); $x++; }
fclose($paged);
}
preg_match("/<title>[\n\r\s]*(.*)[\n\r\s]*<\/title>/", $page, $title);
if ($title[1] == '') { $title[1] = $text[2] . $text[4]; }
return "" . preg_replace("/\&.+\;/", '', $title[1]) . " (" . $text[2] . $text[4] . ")";
}
}
$messagetext = preg_replace_callback(
'#(^|\[/(' . $skiptaglist . ')\])(.*(\[(' . $skiptaglist . ')|$))#siU',
function($m) { return convert_url_to_bbcode_callback_auto_title($m[3], $m[1]); },
$messagetext
);
RESOLVED:
See https://vborg.vbsupport.ru/showthread.php?t=323627
You need to have this setting enabled:
allow_url_fopen = On
djbaxter
06-11-2017, 09:54 AM
To simplify updating for PHP 7.x, use attached product. The text files are for information only: Just delete the 1.5c version and import the new xml product (no files to upload).
Also posted at https://vborg.vbsupport.ru/showthread.php?t=325234
Please post there for support and I'll do what I can to help.
mdawg
06-13-2017, 12:10 PM
Thanks djbaxter. So, I did what rhodium suggested in post #114 but what you updated and attached there is different?
djbaxter
06-13-2017, 12:28 PM
Thanks djbaxter. So, I did what rhodium suggested in post #114 but what you updated and attached there is different?
How is it different?
mdawg
06-13-2017, 12:42 PM
I'm just asking if it is different. I simply did what Rhodium suggested it seems to work, but my forum is http not https.
djbaxter
06-13-2017, 01:04 PM
Oh I see. No. It's just an update that incorporates the changes. People who don't feel comfortable editing the plugin code can just import the new product and this will do the updates automatically. Additionally, one of the text files includes the information on ensuring that allow_url_fopen = On after an upgrade to PHP 7.x.
mdawg
06-13-2017, 01:29 PM
Right, yes,
allow_url_fopen = On
must be on!
Thank you for clarifying.
Alan_SP
06-25-2017, 02:59 PM
I just tried original version, but have one problem. Plugin works great with replacing links with titles, but when I place link to video, AME doesn't translates it into embedded video, but it becomes link.
I tried to play with plugin execution order, it didn't helped (I used 50 and 1).
Is there a way to give AME chance to see if it is video link and then let this plugin does it's work after AME?
EDIT, just to add, AME uses this hooks: data_preparse_bbcode_video_start and data_parse_bbcode_video. Maybe if we include this hooks within plugin code would allow AME to work with it?
mdawg
07-19-2017, 10:56 PM
Okay so should we bail on this entirely and just install this one:
https://vborg.vbsupport.ru/showthread.php?t=325234
( Auto Title Tag Fetcher (Title Tag as Anchor Text) for vB 4.2.5 & PHP7
Mod Version: 2.00, by djbaxter )
?
djbaxter
07-20-2017, 07:58 AM
Okay so should we bail on this entirely and just install this one:
https://vborg.vbsupport.ru/showthread.php?t=325234
( Auto Title Tag Fetcher (Title Tag as Anchor Text) for vB 4.2.5 & PHP7
Mod Version: 2.00, by djbaxter )
?
Either way. My post just incorporates changes and comments already posted here into a package that's easy to install. It works perfectly on my forums.
If you check my post at Auto Title Tag Fetcher (Title Tag as Anchor Text) for vB 4.2.5 & PHP7 (https://vborg.vbsupport.ru/showthread.php?t=325234), you'll see I credit you and the other posts in this thread that my post draws upon.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.