News:

Wondering if this will always be free?  See why free is better.

Main Menu

Titled Links

Started by Mick., July 14, 2007, 12:18:47 PM

Previous topic - Next topic

Mick.

Link to Mod

Titled Links


Created By: SlammedDime
Taken Over: JBlaze
Updated By: JBlaze
Taken Over: idesignSMF
Updated By: idesignSMF
Compatible: SMF 2.0




Introduction
Using this mod will give URLs posted in your topics an automatic title.  I saw this on another forum I visit and thought it to be pretty nifty, so I coded this up for SMF.

If a user posts a link outside of  bbcode tags, this mod will find them, look up the webpage, get the title, and replace the link with a bbcoded url with the webpages title... similar to below:

http://www.mysitehere.com
  
will be transformed into

My Website Title

If the page or title cannot be found, the URL in the post is not changed.

This change is made when the post is made or edited, it is not done on the fly, as that may cause lags in load time.

There are also options in the admin interface for Posts so you can turn this feature on or off, and also limit the number of URLs to convert.

convert_urls.php is a tool that can be used to convert all urls in existing messages to titled urls.  I have tested this on a message table with 12,000 messages and it worked as it should, but I cannot promise that it will always work.  Any errors should be reported to the topic for this mod.

Installation
1. Download from the SimpleMachines.org Mod Site.
2. Upload to your forum using the built-in Package Manager.
3. Install using the built-in Package Manager.

Support
For best support, please visit http://www.jblaze.net/forum.

Changelog

1.5 Updated to SMF 2.0.17
1.2: Taken over by JBlaze, updated for RC3/1.1.11
1.1b: Same bug, typo...
1.1a: Bug with URLs that had regex characters in them.
1.1: No code changes, just updated installer for 1.1.3.
1.1: Added settings to 'Posts And Topics'.  Removed XSS vulnerability.
1.0: Initial Release

vosje505

great mod :D

i love it.

only got 1 problem

you've set it to convert http://www.

but my site begins with http://forum

what do i exactly change to get it replace it when there's only http:// instead of http://www

SlammedDime

#2
Hrm... I'll have to check the regular expression.  Thanks

Edit: It seemed to work fine for me on my test site.  I used the same regex that Simple Machines does when finding urls in a post to automatically link them.  I tested http://forum.myspace.com and it worked.  I also tested http://www.joomla.com and it worked.  Keep in mind, if you were to enter forum.myspace.com, it would not work, conversely if you entered www.joomla.com, it would work.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

vosje505

sorry my mistake.

its not that what caused my problem it are characters like ? and # and thos kinda characters

thanx for looking into it ;)

kamili34

Thanks work wonderful  :P

SlammedDime

SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

#6
Great mod but:

It doesn't seem to work properly with links that don't end with an extension (like the forum topic links).

It works for my site, Google and all that, but if I use a topic url such as http://www.ruthlessintent.com/board/index.php?topic=5000 all I get in the post is the same link, but it is in between a [url*] and then a [/url%] tag. (Yes, the star is there to stop the bbcode taking over, but the percent sign is what is actually on my forum)

Here is an example

http://www.ruthlessintent.com/board/index.php?topic=47624.0
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


SlammedDime

Oops.  I'll upload a new version to use with that bug fixed.  Thanks!  Thats what I get for switching from str_replace to preg_replace.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

vosje505

hi Matt,

im trying your new version 1.1a but now im getting the following error :

Fatal error: Call to undefined function: preg_quot() in /storage/mijndomein/users/040205/public/sites/forum.jccarsystems.nl/Sources/Subs-Post.php on line 313

what can i do about it?

thx in advance

kamili34

I got the same error as user above.  :'(

FUBAR

Quote from: vosje505 on July 15, 2007, 05:37:19 PM
hi Matt,

im trying your new version 1.1a but now im getting the following error :

Fatal error: Call to undefined function: preg_quot() in /storage/mijndomein/users/040205/public/sites/forum.jccarsystems.nl/Sources/Subs-Post.php on line 313

what can i do about it?

thx in advance

I am getting this same error when posting but only when a link is included in the post.

SlammedDime

forgot the e on quote... damn I shouldn't code right before work.  updated to 1.1b...
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

vosje505

Quote from: Matt @ ARTcom on July 16, 2007, 04:24:16 AM
forgot the e on quote... damn I shouldn't code right before work.  updated to 1.1b...

works like a charm  :D :D ;D

thx Matt

only you forgot to upload 1.1b ;) ive changed it manually and it works perfect now.

keep up the great work

vosje505

Quote from: vosje505 on July 16, 2007, 04:45:26 AM
Quote from: Matt @ ARTcom on July 16, 2007, 04:24:16 AM
forgot the e on quote... damn I shouldn't code right before work.  updated to 1.1b...
i was too early great mod Matt

works like a charm  :D :D ;D

thx Matt

only you forgot to upload 1.1b ;) ive changed it manually and it works perfect now.

keep up the great work

I was too early for upload

Great mod Matt

Thanks

SlammedDime

SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

Where has my post disapeared to??

I posted that when I updated It doesnt even let me reply let alone quote.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


fangweile

It doesnt work for me.
Quote
I type http://mysitehere.com but it still displayed
http://mysitehere.com

it is just converted the url to [*url=http://mysitehere.com]http://mysitehere.com[/url]

vosje505

#17
Quote from: fangweile on July 16, 2007, 06:10:18 AM
It doesnt work for me.
Quote
I type http://mysitehere.com but it still displayed
http://mysitehere.com

have you tried an existing site??? like http://www.simplemachines.org

it is just converted the url to [*url=http://mysitehere.com]http://mysitehere.com[/url]


have you tried an existing site? somthing like http://www.simplemachines.org

fangweile

yeah, I have try it but still doesn't work.

kamili34

In my forum mod works ok.  ;)

Advertisement: