I'm not involved in the DT website programming, just the forum, so I can't tell you how its done here, but I can offer you some ideas.
It depends what language you're using for your backend, and how it functions, but it is probably a job for regex. There may be other ways, but using PHP as backend, and assuming your page content is all stored in a string prior to being printed (this is the best way of doing it anyway), you can use preg_replace on the page string.
The idea of this is to convert every <a href="http://www.xyz.com"> into <a href="http://www.yoursite.com/framescript.php?url=http://www.xyz.com">. framescript.php is a page that simply has two frames, one specified by you If we can accomplish this, then we can easily go back and use another preg_replace to revert excluded URLs back to there non-framed form.
preg_replace takes the basic form shown below:
preg_replace ( mixed $pattern , mixed $replacement , mixed $subject )
Where $pattern is a regular expression, specifying where to do replacements, $replacement is what the matched patterns should be replaced with, and subject is the string/array that the replacement is to be performed upon.
I'm a little out of practice with regex, but the pattern you want to match would be something like:
href="(
http://(www\.)?[a-zA-Z0-9\-]{2,64}\.((com)|(net)|(org)))
It looks complex, and is slightly, but if you do a bit of reading up on regex it should come clear. Basically it matches the part of the anchor tag up to the closing quote marks ".
The second part, $replacement, says what we should replace it with. We can use the notation $1 to represent the contents found in the first set of brackets of $pattern, $2 for the second set of brackets etc. The order of bracket numbers is in order of appearance of the
opening bracket. Our $replacement would look something like:
href="http://www.mysite.com/framescript.php?url=$1
If we feed in our page string to $subject, then this should perform the replacement for us.
Now we need to deal with the exclusions you want. $pattern can not only be a pattern string, as above, but also an array of patterns. We'll take advantage of this by making an array of excluded websites:
$prefix="href=\"http://www.mysite.com/framescript.php?url=((www\.)?";
$suffix=")"
$exclude[0]=$prefix . "excludedsite1.com" . $suffix;
$exclude[1]=$prefix . "excludedsite2.net" . $suffix;
Then using preg replace to replace matched pattern with the contents of the first brackets. This finds instances of excluded sites being redirected to the frame page, and sets them back to regular links.
Now this is totally untested, and off the top of my (rusty) head, so don't expect to copy paste and use! Hopefully though it gives an insight into regex, and how you can use it to solve your problem. It's a slightly tricky subject, but there are many many good tutorials out there, so try reading round a few. I found the best way to learn was to set myself some challenges, and complete them with reference handy, then try similar challenges with no reference. Good luck, it's not a simple task you've set yourself here!