evan
Jun 1 2002, 04:58 PM
Or, does anyone know how to call up MT's search and replace function in Perl, or know where it's located in MT's files? My hope is have a script which goes through the files and replaces all the bands' names with links to their sites.
kadyellebee
Jun 3 2002, 03:01 PM
Lynda has a full tutorial on her site for this -
Smilies Hack - scroll to the bottom and it talks about using text to create links.
hope this helps too

Kristine
evan
Jun 1 2002, 09:41 AM
Is there any way to make MT automatically change certain phrases into links?
Thanks.
You can open up Util.pm.
and find the lines:
my $str = shift;
$str ||= '';
Now under that you should be able to add your subs, its probably helpful to know some perl, but here is an example.
$str =~ s/MT/MovableType/g;
In this example you'll need to change MT for the word or phrase you looking for and MovableType, is the word you want to change it to.
There are case with special characters and perl that require a \ before hand.
Rember always back up your stuff before you edit them, just in case.
evan
Jun 3 2002, 09:01 PM
Hey, thanks a lot. That works fine for the entries, but it doesn't change the titles. Any idea how to make it also affect those?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.