Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

scem0

macrumors 604
Original poster
On many sites, scripts are implemented to go through the site and search through every document finding strings and replacing them with something different.

I'd like to find a script that does this to implement it on my website. And, I'm not just talking about manual replacement, I'm talking about automatic replacement. I could use Dreamweaver to do it by myself, but that would take forever, and I don't want to have to do it every week ><.

To get an example of what I mean, check out Wikipedia.

If you look at an article (example: http://en.wikipedia.org/wiki/PHP ) you can see that every time the word 'MySQL' is used, it links to the Wikipedia article of MySQL. Anytime 'MySQL' is in an article, it links to the 'MySQL' article. I'm sure they wrote their own script to do this, but I'm betting there is one for lazy people, somewhere.

I just want a script that will look through my website for the word 't-shirt' and will link that text to my t-shirt section of my site. Likewise for the text 'review', 'reviews', 'tshirt', 'tshirts', 't-shirts', etc.

I can't seem to find a script that does this.

Edit - Since I'm asking about this script, I might as well ask for another script I've been trying to find. I need a script to manage reviews at my website, which is a music review script. I was going to use 'FusionReview', but it isn't all that great. I've tried searching through hotscripts and sourceforge, but there are so many different scripts and it is hard to tell which ones are good, or which ones do exactly what you want them to do.

I basically want an article management system that supports rating the subject under discussion in the article (so things can be ordered according to rating, and whatnot). Any suggestions?

Thanks,

scem0
 
Check out preg_replace - works pretty well once you get up to speed with regular expressions. The trick is to get all your web page content into a string the function can parse.
 
xelterran said:
use the strip_tags() function to get the content into a string, then pass that to preg_replace()

Not sure if that's the best route since it'd lose any HTML he wanted in there.

The only thing that comes to mind is to use include/require for each content section and pass that into the string to process with preg_replace(). Kind of a lot of work to get everything set up that way, but it gives you more flexibility in the long run.
 
Yeah, I have dreamweaver, so I can already do it manually, but I'd like it to do it automatically to all pages on my site, including dynamically created webpages, like posts in a thread.

scem0
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.