Jump to content
Web Marketing Help Forum
nixwebo

Need a Real Programmer - Please Help

Recommended Posts

I have been running a website using Joomla for some time now and I am nothing but impressed. I want to setup the site so that all external links open in a new window with 2 frames, one with the site requested and one with my Google ad sense ads. The problem is that I have hundreds of entries on the site and I really do not want to manually change all of these links.

 

So I guess the question is..Can this be done with mod_rewrite or some such?

 

If anybody has any input please let me know, I would be happy to give many a link back to the site of your choice in exchange or whatever I can do for you but I am not sure I am in the situation to pay for this as of now, sorry.

 

Thanks in advance,

 

Nick

Share this post


Link to post
Share on other sites

You can add a JavaScript like

>function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i  if(!anchors[i].href.match('www.example.com/'))
   {anchors[i].target = "_blank";}
       }
}
window.onload = externalLinks;

Then any link that does not have http://www.example.com in it will load in a new window.

 

Are you using server side includes or something like that to help you maintain the site?

Share this post


Link to post
Share on other sites

Thank you for your response.

 

Should this work from a php page. The site is ran on a php based cms app called joomla. I tried the code in one of the content posts and it does not seem to function.

 

Please let me know what else I may try, Thanks again,

 

Nick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×