News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Titled Links

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

Previous topic - Next topic

L.G.S

Your mod seems to be selective of something.

If I add my topic links into a post, some will work and some will give me the % url bbcode again.

If I edit this same post, then click save, it will change what links work and what don't, AGAIN.

My links are all the same in terms of the URL so what's the problem with this mod?
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


SlammedDime

Have you changed any of the settings for the mod?  Under Post and Topics in your settings.  The default number of links to change is 5, so if you have 10 links in your post, and click save, the first 5 will be changed.  If you edit the post and save it again, the second 5 will then be changed, and so on and so forth.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

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

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

Using that specific example returns the proper result... visit mysitehere.com... see what the title is...
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

ok thanks it worked.

FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


fangweile

I used simplemachines.org as my example but it only display this.

[url=http://www.simplemachines.org/]http://www.simplemachines.org/[/url]

L.G.S

Is there anyway to make all posted links change into titled links? Right now I have  a lot of links that I want to change but its not possible to go into every post and resave.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


SlammedDime

Quote from: L.G.S on July 17, 2007, 08:35:33 AM
Is there anyway to make all posted links change into titled links? Right now I have  a lot of links that I want to change but its not possible to go into every post and resave.
Based on the stats on your board, you have over 120000 posts.... I would imagine that it would take a great deal of time for a script to run through every post and change any urls found inside of it.  I could write a script to do it, but I have no clue as to how long it would take or what server load would be incurred.  I would recommend that you test the script on a backup database/smf install first to be sure that it will work properly first.

fangweile - do you have a live version of this somewhere that I can test?  I tested 5 different variations of the sm.org url, and all but one work worked, and rightfully so.  The other thing I could suggest is to visit Sources/Subs-Post.php, find the added code from the mod, and you'll see a line that says $request = @file_get_contents($uri_modified);.  Remove the '@', try again, and then view your forum error log to see if there are any errors, and if so, report them back here.

Did you visit your admin panel under Posts and Topics and ensure that the mod is turned on?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

Thanks, I'd like the script if you can :P
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


SlammedDime

Quote from: L.G.S on July 17, 2007, 03:59:36 PM
Thanks, I'd like the script if you can :P
No problem, I'll see if I can whip it up tomorrow.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

I haven't forgotten about you.  I'm looking at a few different scripts to modify to accomplish what is needed without crashing the server due to load and also ensure that things are setup properly before the script is run.  Main reason: might not be a bad idea to include it for those that wish to do the same. :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

Thanks. Can it also have a break of 30 seconds between each part? My host is picky with that kind of thing
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


SlammedDime

Quote from: L.G.S on July 20, 2007, 04:42:48 AM
Thanks. Can it also have a break of 30 seconds between each part? My host is picky with that kind of thing
It can be done, but I think the way I am coding it, 30 seconds won't be needed.  I'm going to generate upwards of 500,000 messages into my test database to test this on.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

Ok, I've finished the tool.  Let me know how it goes.  I've attached it to the mods download page.

A brief overview of what it does:
It works 500 messages at a time, pulling them from the database, running through them one at a time, discarding the ones that don't have urls, and converting the urls in the ones that do.  It then updates any messages changed in the database.  It then pauses for 5 seconds, where you can see the status of the script, then continues.  I've monitored my system while this was running on a 12000 row message table and the cpu usage was nill.  The main factor in time is the response from the websites the script is getting the urls from.  I've used the same time limit of 3 seconds for retreiving the title that I did in the mod itself.  If it doesn't happen within 3 seconds, the url is skipped.

After the tool is done, it will print some stats.  I'm very curious in them and would appreciate you posting them.  I can't give a good time estimate on how long it will take to convert the urls, but I will say that with over 120000 posts, it will take a minimum of an hour.  I figure around 5% of the messages will have urls, so thats at least 6000 urls, and at an average of around 1 second an url, you're looking to have at least 1.5 hours for the conversion.  The script does require that your board is in maintenance mode, so no one will be able to access your board while you're doing this.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

Seeing as you say it may take an hour, I'll wait until tomorrow, do the script then post the result ;)
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


SlammedDime

If you have a backup of your database, I would strongly suggest that you test this on a backup.  If you dont have one, I would STRONGLY suggest you create one before doing this.  This script worked just fine locally, but I have no idea how it will work in the real world.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Mr.CoWbOy

HeLLo..

its very nice thnx for it..

but ; it didnt work on my forum..

i tried a few links and didnt change anythng.. and i uninstall again..

i ll wait new version (:

SlammedDime

It works just fine.  Did you make sure that it was enabled in your forum Admin under Post settings?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

L.G.S - Did you ever get around to running the converter?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

L.G.S

Uploading my database now, I'll post when its done ;)
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


karlbenson

line 35 of install.xml typo
$timeout = ini_get('default_socket_tiemout');

Advertisement: