vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - External Link Titles, retrieve descriptive titles for URLs (https://vborg.vbsupport.ru/showthread.php?t=146679)

magnus 05-06-2007 10:00 PM

External Link Titles, retrieve descriptive titles for URLs
 
Keywords: SHOWTHREAD, external, link, titles, URLs, SEO

Description:
Retrieves descriptive titles for external posted links. Allows for better link recognition and, in theory, could help increase page SEO.

Details:
I recall this being requested somewhere, so I decided to take a stab at it. This is yet another feature offered in vBSEO.

For those unaware of what this actually does.. by default, when a URL is posted without a description it looks like:
http://www.vbulletin.com

With this modification enabled, it will now look like:
vBulletin.org Forum - The Official vBulletin Resource!

Nicer, eh?

[hr]-[/hr]
Installation:
  1. Download and import product-linktitles.xml via the Product Manager.
  2. Enable the modification via AdminCP > vBulletin Options > External Link Titles Options (it is disabled by default)
  3. ???
  4. Profit!

Notes:
There's really no magic here, it polls for titles using the cURL() function. If for some reason your host does not have cURL() enabled, you're out of luck.

From time to time you may notice the occasional link that does not get titled -- this is due to either the fact that the url is not active or it either timed out waiting for a response. By default, the system will wait for 5 seconds before timing out. If you wish to modify the timeout, you may do so via the AdminCP.

[hr]-[/hr]
Comments:
As with all my hacks, this modification is provided free of charge. However, if you find this product useful and have money burning a hole in your pocket, feel free to make a small donation, I won't mind.. really. :)

Version History:
  • 1.0.0 - Initial release, here's to hoping...
  • 1.1.0 - Added the ability to blacklist specific domains from having link titles retrieved (configurable via the AdminCP)
  • 1.1.1 - Wrapped returned titles in html_entity_decode(); to return properly decoded HTML characters.

Currently Known Bugs:
  • None

* Please note that this modification was developed on a forum with a userbase of 1 (myself). I've tested it for basic functionality but I cannot guarantee functionality or behavior on your forum. So, please -- make backups before installing this product!

magnus 05-07-2007 05:58 PM

Holding this space..

Terminatoronly 05-07-2007 06:50 PM

First Install

Great Mod :)

Charlie98902 05-07-2007 09:11 PM

Second Install! :)

Stoebi 05-07-2007 09:23 PM

Hello,

thank you very much for this nice hack :)

I've found a little bug in the 2 plug-ins.
Please change
PHP Code:

if (isset($vbulletin->options['linktitles_active'])) 

to
PHP Code:

if ($vbulletin->options['linktitles_active']) 

Regards,

Stoebi

projectego 05-07-2007 09:29 PM

Awesome!

/me clicks install

magnus 05-07-2007 10:03 PM

Quote:

Originally Posted by Stoebi (Post 1243261)
Hello,

thank you very much for this nice hack :)

I've found a little bug in the 2 plug-ins.
Please change
PHP Code:

if (isset($vbulletin->options['linktitles_active'])) 

to
PHP Code:

if ($vbulletin->options['linktitles_active']) 

Regards,

Stoebi

Nice catch, thanks.

Charlie98902 05-07-2007 10:27 PM

For some reason on my board the update fails to work but the initial release does?

magnus 05-07-2007 10:38 PM

Quote:

Originally Posted by Charlie98902 (Post 1243305)
For some reason on my board the update fails to work but the initial release does?

Very the product is set to enabled. AdminCP > vBulletin Options > External Link Titles Options > External Link Titles Enabled (Make sure 'Yes' is checked)

Charlie98902 05-07-2007 10:55 PM

Quote:

Originally Posted by magnus (Post 1243316)
Very the product is set to enabled. AdminCP > vBulletin Options > External Link Titles Options > External Link Titles Enabled (Make sure 'Yes' is checked)

Thanks for the support as it is stated not supported. :D

Yes that was the issue, as when I used the initial release I guess it was on by default then as I didn't go into the admin panel.:up:

Quantnet 05-08-2007 03:23 AM

Installed and enabled the hack. Yes is checked.
Server has curl enabled.

When i post something new and click on review, I have this error at the top of the page

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /includes/functions_newpost.php(360) : eval()'d code on line 56

Quantnet 05-08-2007 03:41 AM

As a followup, I edited the functions_newpost.php file and add after the <?php tag

// Turn off all error reporting
error_reporting(0);

Not sure if this is a proper way to do it. If anyone knows , please let me know.

HMBeaty 05-08-2007 03:45 AM

/me installed and works PERFECT. Thank you

elmati 05-08-2007 03:47 AM

installed!
thx!

Hornstar 05-08-2007 05:29 AM

hey nice work, good to see you releasing good stuff, even tho im using vbseo, im sure others will find this usefull.

bollie 05-08-2007 05:56 AM

Nice ;)

dizzy100 05-08-2007 07:58 AM

Excellent addition and works perfectly. Many thanks.

magnus 05-08-2007 10:33 AM

Quote:

Originally Posted by Quantnet.org (Post 1243426)
Installed and enabled the hack. Yes is checked.
Server has curl enabled.

When i post something new and click on review, I have this error at the top of the page

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /includes/functions_newpost.php(360) : eval()'d code on line 56

You're running PHP in Safe Mode.

magnus 05-08-2007 12:03 PM

Update:
v1.1.0
  • Added the ability to blacklist specific domains from having link titles retrieved (configurable via the AdminCP)
[hr]-[/hr]
This is the only thing that has changed. If you don't care about blacklists, you don't have to upgrade. :)

Masiello 05-08-2007 06:17 PM

Great product, thanks *installed*

Stoebi 05-09-2007 04:26 AM

I've problem with special characters like & in the title.

Example:
http://www.my-vb.de/board/ankuendigungen-my-vb-teams
=>
Ank?ndigungen des my-vB Teams - my-vB - Addons &amp; Styles - Made in Germany https://vborg.vbsupport.ru/


Regards,

Stoebi

Seb@ 05-09-2007 09:37 PM

any demo or screenshot ?

HMBeaty 05-09-2007 10:16 PM

Quote:

Originally Posted by Seb@ (Post 1244606)
any demo or screenshot ?

Screenshot of what???

All it does is change a link, for example you put www.vbulletin.com, it changes it to vBulletin - Home or something like that.

magnus 05-09-2007 10:20 PM

Quote:

Originally Posted by Seb@ (Post 1244606)
any demo or screenshot ?

If the original description wasn't enough, sadly a demo or screenshot wouldn't help either.

magnus 05-09-2007 10:20 PM

Quote:

Originally Posted by Stoebi (Post 1244158)

Noted. I'll take a look at that, thanks.

KiD0M4N 05-10-2007 10:32 PM

My friend Ad1tya had requested this and here it is. Mod released. Helluva forum guys :)

Installed :) and working like charm.

staff80 05-13-2007 01:19 AM

seems it doesn't work on 3.6.6. At least for me. It's enabled and nothing changed.

HMBeaty 05-13-2007 02:46 AM

Quote:

Originally Posted by staff80 (Post 1246554)
seems it doesn't work on 3.6.6. At least for me. It's enabled and nothing changed.

Works perfectly fine for me

Surviver 05-13-2007 04:47 AM

I would use the function fetch_censored_text() for the title ;)

Greetings Surviver

C_P 05-15-2007 12:09 AM

Quote:

Originally Posted by Quantnet.org (Post 1243426)
Installed and enabled the hack. Yes is checked.
Server has curl enabled.

When i post something new and click on review, I have this error at the top of the page

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /includes/functions_newpost.php(360) : eval()'d code on line 56

I get similar error and PHP safe mode is not on:
safe_modeOffOff
safe_mode_gidOffOff
Here is my error:
Quote:

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /includes/functions_newpost.php(360) : eval()'d code on line 30
and after i resolves back to thread it was posted in, my http://www.vbulletin.org displays this as the hyperlink:
301 Moved Permanently link test
Now, this could be do the he anonym modification we have installed. If so, we cannot install this but a nice option none the less.

magnus 05-15-2007 12:48 PM

Quote:

Originally Posted by C_P (Post 1247724)
I get similar error and PHP safe mode is not on:
safe_modeOffOff
safe_mode_gidOffOff
Here is my error:
and after i resolves back to thread it was posted in, my http://www.vbulletin.org displays this as the hyperlink:
301 Moved Permanently link test
Now, this could be do the he anonym modification we have installed. If so, we cannot install this but a nice option none the less.

Well, according to the error:
Quote:

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /includes/functions_newpost.php(360) : eval()'d code on line 30
It's either one of 2 things. You verified safe mode isn't enabled, so there must be an open_basedir set in functions_newpost.php. You'll need to check for plugins that hook into your the file, and see if there's a way to resolve the error.

The reason the link shows as "301 Moved Permanently" is because vBulletin.org has a redirect to the portal page. The CURLOPT_FOLLOWLOCATION option tells the modification to follow all redirect tags until the end. Since you can't use that option, it stops on the first try.

You can still use the modification, you would simply have to disable CURLOPT_FOLLOWLOCATION and occasionally be stuck with links such as "301 Moved Permanently" in such cases.

C_P 05-15-2007 12:52 PM

Thank you for the reply and update.

Dave Hawley 06-07-2007 03:59 AM

Would this work on 3.5.4? If not, is there one for that version?

Quantnet 07-13-2007 01:45 PM

Any update on the &amp and quotation issue ?

I have something like this The iPhone - Doesn&amp;#039;t Slice, Doesn&amp;#039;t Dice, but Will It Blend? | CrackBerry.com

magnus 07-13-2007 02:01 PM

Quote:

Originally Posted by Dave Hawley (Post 1262925)
Would this work on 3.5.4? If not, is there one for that version?

It should work, but I haven't tested. It couldn't hurt to try.

magnus 07-13-2007 02:02 PM

Quote:

Originally Posted by Quantnet.org (Post 1289971)
Any update on the &amp and quotation issue ?

I have something like this The iPhone - Doesn&amp;#039;t Slice, Doesn&amp;#039;t Dice, but Will It Blend? | CrackBerry.com

To be honest, I completely forgot about that issue. I'll go ahead and take a look at it right now. I'm sure it's an easy fix.

My apologies!

Dave Hawley 07-15-2007 07:03 AM

It shows this error on import into 3.5.4

Quote:

Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '5', 'Retreive link titles when editing a post', 'editpost_update_process', 'if ($vbulletin->options[\'linktitles_active\'])\r\n{\r\n preg_match_all(\'/\\[url\\](.*)\\[\\/url\\]/Ui\', $edit[\'message\'], $matches, PREG_SET_ORDER);\r\n\r\n foreach($matches as $match)\r\n {\r\n $url = parse_url($match[1]);\r\n $url_host = $url[\'host\'];\r\n $blacklist = preg_split(\'#\\s#\', $vbulletin->options[\'linktitles_blacklist\'], -1, PREG_SPLIT_NO_EMPTY);\r\n\r\n $host_is_blacklisted = false;\r\n foreach ($blacklist as $host)\r\n {\r\n if (preg_match(\'#\' . preg_quote($host, \'#\') . \'$#siU\', $url_host))\r\n {\r\n $host_is_blacklisted = true;\r\n break;\r\n }\r\n }\r\n unset($blacklist);\r\n\r\n if ($host_is_blacklisted == false)\r\n { \r\n if (function_exists(\'curl_init\') AND $ch = curl_init())\r\n {\r\n curl_setopt($ch, CURLOPT_URL, $match[1]);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, $vbulletin->options[\'linktitles_timeout\']);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_HEADER, false);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n\r\n $file_contents = curl_exec($ch);\r\n }\r\n\r\n preg_match(\'/<title>(.*)<\\/title>/i\', $file_contents, $title);\r\n\r\n if ($title[1] != \'\')\r\n {\r\n $edit[\'message\'] = str_replace($match[0], \' . \'\"]\' . $title[1] . \'\', $edit[\'message\']);\r\n }\r\n }\r\n }\r\n}', 'linktitles');

MySQL Error : Unknown column 'executionorder' in 'field list'
Error Number : 1054

Quantnet 07-24-2007 12:15 AM

Quote:

Originally Posted by magnus (Post 1289978)
To be honest, I completely forgot about that issue. I'll go ahead and take a look at it right now. I'm sure it's an easy fix.

My apologies!

Any updates ?
This shouldn't take you this long right ? :)

TheMilkCarton 07-24-2007 01:20 AM

My blacklist just doesn't work. I tried blacklisting a .net if that makes any diff.

Everything else works, though. :)

magnus 07-24-2007 10:13 AM

Quote:

Originally Posted by Quantnet.org (Post 1299693)
Any updates ?
This shouldn't take you this long right ? :)


No, it shouldn't.. and that's the funny part. Everytime I think I have it fixed, I find a character that for some reason won't translate over. It's as if certain html codes are exempt from being translated. I've gotten most simple characters such as &amp;, &copy;, etc. working fine, but other such as foreign lettering and fractions aren't working. It's the damndest thing..


All times are GMT. The time now is 05:55 PM.

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.03778 seconds
  • Memory Usage 1,840KB
  • 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_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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