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

Macman1993

macrumors 6502
Original poster
Nov 23, 2007
337
16
I have a confusing question that I have spent hours trying to solve with no luck and I'm hoping someone here can help me.

I made an iframe that shows a recently added videos portion of a website I run, I want to add this iframe to another website in order to get more views but I've run into an obvious problem. Every link I open opens within the iframe not in a new window like I want it to be. Heres where the confusion starts. The links are all server generated in some very confusing code and new videos are uploaded all the time so adding target = "_blank" (not sure if I got that right I never remember it but thats besides the point) will not be a reasonable solution. I'm hoping that there is some kind of code out there that will just automatically add target= "_blank" to every link on the page. The links are generated inside a file called recent.ini and a page called index.php displays the links. I made a separate page called index2.php which displays content the exact same way as the normal index.php page that I am ok with just setting every link on to just opening in a new window but I just have no idea how to do this. If anyone can help me with this problem I would really appreciate it so I can stop pulling my hair out over this.

P.S. I understand that this was probably confusing so if you didn't understand I will try to make more sense.
 
I don't have a preference really the file it will go into is a php file so I figured the attribute would be in php but if javascript works I'm fine with that. Also keep in mind I have never used either of these languages so I might need a bit more detail of where to paste the attribute.
 
If doing in PHP is an option, then I would do it there as anyone with JavaScript disabled won't get those changes. We'll need to see the PHP file in order to say where the change needs to be made. Essentially though you'll be looking for the <a href="..> parts and adding in the attribute.
 
The code that effects the actual links for the videos isn't included in the index.php file but in the file thats called latest2.inc. It is normally latest.inc but because I don't want the default setting to be to make the links open in a new window I made a new one that should be used in only the index2.php file at this time the index2.php file doesn't use the file latest2.inc I couldn't find where it links to it in the index.php file so I'm hoping you can find that. So here is the latest2.inc file which I think is actually some object oriented programing language, html and php mix which is why I figured we should just make a change on the index.php file but you know whats going on better then me so I'll just go with whatever you think is best.

Code:
<? 
//VidiScript - All Coding And Design @VidiScript.com 2009
//
//File: index.php
//Description: Main index page - all site content is displayed through this page
//Version 0.43 BETA
//Release Date: 06/05/08
//
session_start();
ini_set("magic_quotes_gpc", "0");
error_reporting(E_ERROR);
include_once 'includes/bootstrap.inc';
include_once 'includes/common.inc';
include_once 'includes/content.inc';
include_once 'includes/news.inc';
global $sitepath,$hidethumbnails,$hidemedia;
$site_template = getSetting("sitetemplate", $db);
if (!file_exists("templates/".$site_template."/style.css")) {
	$site_template = "main";
	echo $site_template." not found using default";
}
//Get page title if it exists
if (isset($c_header)) {
	$s_header = str_replace("<strong>", "", $c_header);
	$s_header = str_replace("</strong>", "", $s_header);
	$s_header .= " - ";
}
else {
	$s_header = "";
}
//Get installation folder from db
$sitefolder = getSetting("sitefolder", $db);
$langy = getSetting("language", $db);
###############################################################
#  REQUIRED FOR J-MODS
###############################################################
$refer = $_SERVER['HTTP_REFERER'];
$refer = str_replace('http://', '', $refer);
$domain = explode("/", $refer);
$domainK = $domain[0];
$sql = "SELECT * FROM `ips` WHERE `ip` = CONVERT(_utf8 '".$_SERVER["REMOTE_ADDR"]."' USING latin1) COLLATE latin1_swedish_ci";
$check = $db->query($sql) or die("bad");
$check_ip = $db->numRows();
$sql = "SELECT * FROM `traffic` WHERE `Url` = CONVERT(_utf8 '".$domainK."' USING latin1) COLLATE latin1_swedish_ci";
$check2 = $db->query($sql) or die("bad2");
$check_refer = $db->numRows();
if (($check_ip == 0) && ($check_refer == 1)) //If the Query shows 0 results
{
	$db->query("INSERT INTO ips (ip) VALUES ('".$_SERVER['REMOTE_ADDR']."')");
	$db->query("UPDATE `traffic` SET `In` = `In` + 1 WHERE Url = '".$domainK."'");
}
###############################################################
#  REQUIRED FOR J-MODS
###############################################################
//Path to the script
$path = "http://".$_SERVER['SERVER_NAME'].$sitefolder;
?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <base href="new" />
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
        <script type="text/javascript" src="<?php echo $sitepath?>includes/swfobject.js">
        </script>
        <script>
            <!--
            function doBlink(){
                var blink = document.all.tags("blink")
                for (var i = 0; i < blink.length; i++) 
                    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
            }
            
            function startBlink(){
                if (document.all) 
                    setInterval("doBlink()", 1500)
            }
            
            window.onload = startBlink;
            // -->
        </script>
        <script src="<?php echo $path;?>js/AC_RunActiveContentWN.js" language="javascript">
        </script>
        <script src="<?php echo $path;?>js/AC_RunActiveContent.js" language="javascript">
        </script>
        <script src="<?php echo $path;?>js/Animated.js" language="javascript">
        </script>

        <script type="text/javascript" src="<?php echo $sitepath?>js/css.js">
        </script>
        <script type="text/javascript" src="<?php echo $sitepath?>js/sifr.js">
        </script>
        <script type="text/javascript" src="<?php echo $sitepath?>js/behaviour.js">
        </script>
        <style type="text/css">
        </style>
        <meta name="description" content="<?php echo isset($mediaDescription)?$mediaDescription:"YOUR DESCRIPTION"; ?>">
        <meta name="keywords" content="<?php echo isset($mediaKeywords)?$mediaKeywords:"YOUR KEYWORDS"; ?>">
        <title><?php echo $s_header?><?php echo getSetting("sitename", $db)?> - <?php echo getSetting("sitetitle",
        	 $db)?></title>
        <?php 
        if ($_GET['id'] >= 100) {
        	
        ?>
        <link href="<?php echo $path;?>templates/default/admin.css" rel="stylesheet" type="text/css" />
        <?php 
        }
        ?>
        <link href="<?php echo $path;?>templates/<?php echo $site_template?>/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript">
            <!--
            //--><![CDATA[//><!--
            try {
                document.execCommand("BackgroundImageCache", false, true);
            } 
            catch (err) {
            }//--><!]]>
        </script>
    </head>
    <body>
        <div id="header">
            <div class="wrapper">
<?php echo $headerad?>
                <a id="logo" href="" title="Home">
                    Logo text here
                </a>
                <ul id="tab-menu" class="no-format">
                    <li<?php if ($_GET['id'] == 1) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>">
                                Home
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 2) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>top_rated">
                                Top Rated
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 3) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>most_viewed">
                                Popular
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 88) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>members">
                                Members
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 19) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>groups">
                                Groups
                            </a>
                        </span>
                    </li>
                    <?php 
                    if ($loggedIn) {
                    	
                    ?>
                    <li>
                        <span>
                            <a href="<?php echo $path;?>logout">
                                Log Out
                            </a>
                        </span>
                    </li>
                    <?php 
                    }
                    else {
                    	
                    ?>
                    <li<?php if ($_GET['id'] == 6) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>register">
                                Register
                            </a>
                        </span>
                    </li>
                    <?php 
                    }
                    ?>
                    <li<?php if ($_GET['id'] == 5) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>upload">
                                Upload
                            </a>
                        </span>
                    </li>
                </ul>
            </div>
        </div>
        <?php 
        if (!checkBan($_SERVER['REMOTE_ADDR']) > 0) {
        	
        ?>
        <div id="sub-bar">
            <div class="wrapper">
                <div id="top-search">
<?php echo searchBox()?>
                </div>
            </div>
        </div>
        <div id="content-area">
            <div id="main-col">
<?php include_once ("templates/".$site_template."/modules/content.module")?>
            </div>
            <div id="right-col">
                <div class="inner">
                    <?php 
                    if (($loggedIn) && (($_SESSION['username']) != '')) {
                    	if ((!$accountManagementPage) || (getSetting("accountpageon", $db) == 0)) {
                    		
                    ?>
                    <div id="right-top-wrap">
                        <div id="login-box">
                            <h2>
                                Menu
                            </h2>
                            Logged in as <?php echo $_SESSION['username']; ?>
                            <ul>
                                <li>
                                    <a href="<?php echo $sitepath?>account">
                                        <b>Account Management</b>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/inbox">
                                        Inbox : <?php echo $numMessages?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/outbox">
                                        Outbox : <?php echo $numSentMessages?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/myfriends">
                                        My Friends : <?php echo $approvedFriends?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/myreceivedrequests">
                                        Received Requests : <?php echo $receivedRequests?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/mysentrequests">
                                        Sent Requests : <?php echo $sentRequests?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/blocked">
                                        Blocked Members : <?php echo $numBlocked?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/subscriptions">
                                        Subscriptions : <?php echo $numSubs?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/favorites">
                                        Favorites : <?php echo $numFavorites?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/media">
                                        My Media : <?php echo $numMedia?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/managegroups">
                                        My Groups : <?php echo $numGroups?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/profile?>">
                                        My Profile
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/history">
                                        History
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/profilehistory">
                                        Profile Views
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <?php 
                    }
                    }
                    else {
                    	
                    ?>
                    <div id="right-top-wrap">
                        <form method="post" action="<?php echo $sitepath?>includes/login.php">
                            <div id="login-box">
                                <h2>
                                    log in
                                </h2>
                                <?php 
                                if (isset($_SESSION['loginerr'])) {
                                	echo "<h4>".$_SESSION['loginerr']."</h4><br>";
                                	unset($_SESSION['loginerr']);
                                }
                                ?>
                                <h4>
                                    username
                                </h4>
                                <div class="login-field">
                                    <input tabindex="1" value="" name="user" type="text" class="field" />
                                </div>
                                <h4>
                                    password
                                </h4>
                                <div class="login-field">
                                    <input tabindex="1" name="pass" type="password" class="field" />
                                </div>
                                <div id="lost-passw">
                                    <a href="<?php echo $sitepath?>forgot" title="Click here to recover your password">
                                        <u>
                                            Lost Password ?
                                        </u>
                                    </a>
                                    <input value="log in" name="" type="submit" id="login-btn" />
                                </div>
                                <p>
                                    No account yet ? 
                                    <a href="<?php echo $sitepath?>register" title="Click here to create new account">
                                        <u>
                                            Register
                                        </u>
                                    </a>
                                </p>
                                <label>
                                    <input name="" type="checkbox" value="" />Remember me
                                </label>
                            </div>
                        </form>
                    </div><?php } ?><? eval(menuBlocks()); ?>
                    <div id="right-col-content">
                        <div class="spacing">
                            <a href="<?=$sitepath?>news/">
                                <h2>
                                    <img border=0 src="<?=templateimagepath()?>icn_categories.jpg" alt="" />News 
                                </h2>
                            </a>
                            <br/>
                            <br/>
                            <? 
                            $toEcho = ReturnSideBarNews();
                            echo $toEcho;
                            ?>
                        </div>
<? include_once "templates/".$site_template."/modules/tags.module"; ?><? include_once "templates/".$site_template."/modules/showfriendsbar.module"; ?><?= $adblock1?>
                    </div>
                </div>
            </div>
            <?php 
            }
            else {
            	
            ?>
            <div id="sub-bar">
                <div class="wrapper">
                </div>
            </div>
            <div id="content-area">
                <div id="main-col" align=center>
                    <h1>
                        <b>You have been banned by admin</b>
                    </h1>
                </div>
            </div>
            <?php 
            }
            ?>
            <div id="copyright-bar">
                <div class="wrapper">
<?php echo getCopyrightMessage()?> | <b>
                    <a href="<?=$sitepath."rss.php"?>">
 Rss Feed
                    </a>
                </div>
            </div>
            <div id="footer">
            </div>
            </body>
        </html>

I'm putting the index2.php file in another post because it was to big to have both sections of code in one post.
 
Heres the index2.php file code

And this is the index2.php file

PHP:
<? 
//VidiScript - All Coding And Design @VidiScript.com 2009
//
//File: index.php
//Description: Main index page - all site content is displayed through this page
//Version 0.43 BETA
//Release Date: 06/05/08
//
session_start();
ini_set("magic_quotes_gpc", "0");
error_reporting(E_ERROR);
include_once 'includes/bootstrap.inc';
include_once 'includes/common.inc';
include_once 'includes/content.inc';
include_once 'includes/news.inc';
global $sitepath,$hidethumbnails,$hidemedia;
$site_template = getSetting("sitetemplate", $db);
if (!file_exists("templates/".$site_template."/style.css")) {
	$site_template = "main";
	echo $site_template." not found using default";
}
//Get page title if it exists
if (isset($c_header)) {
	$s_header = str_replace("<strong>", "", $c_header);
	$s_header = str_replace("</strong>", "", $s_header);
	$s_header .= " - ";
}
else {
	$s_header = "";
}
//Get installation folder from db
$sitefolder = getSetting("sitefolder", $db);
$langy = getSetting("language", $db);
###############################################################
#  REQUIRED FOR J-MODS
###############################################################
$refer = $_SERVER['HTTP_REFERER'];
$refer = str_replace('http://', '', $refer);
$domain = explode("/", $refer);
$domainK = $domain[0];
$sql = "SELECT * FROM `ips` WHERE `ip` = CONVERT(_utf8 '".$_SERVER["REMOTE_ADDR"]."' USING latin1) COLLATE latin1_swedish_ci";
$check = $db->query($sql) or die("bad");
$check_ip = $db->numRows();
$sql = "SELECT * FROM `traffic` WHERE `Url` = CONVERT(_utf8 '".$domainK."' USING latin1) COLLATE latin1_swedish_ci";
$check2 = $db->query($sql) or die("bad2");
$check_refer = $db->numRows();
if (($check_ip == 0) && ($check_refer == 1)) //If the Query shows 0 results
{
	$db->query("INSERT INTO ips (ip) VALUES ('".$_SERVER['REMOTE_ADDR']."')");
	$db->query("UPDATE `traffic` SET `In` = `In` + 1 WHERE Url = '".$domainK."'");
}
###############################################################
#  REQUIRED FOR J-MODS
###############################################################
//Path to the script
$path = "http://".$_SERVER['SERVER_NAME'].$sitefolder;
?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <base href="new" />
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
        <script type="text/javascript" src="<?php echo $sitepath?>includes/swfobject.js">
        </script>
        <script>
            <!--
            function doBlink(){
                var blink = document.all.tags("blink")
                for (var i = 0; i < blink.length; i++) 
                    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
            }
            
            function startBlink(){
                if (document.all) 
                    setInterval("doBlink()", 1500)
            }
            
            window.onload = startBlink;
            // -->
        </script>
        <script src="<?php echo $path;?>js/AC_RunActiveContentWN.js" language="javascript">
        </script>
        <script src="<?php echo $path;?>js/AC_RunActiveContent.js" language="javascript">
        </script>
        <script src="<?php echo $path;?>js/Animated.js" language="javascript">
        </script>

        <script type="text/javascript" src="<?php echo $sitepath?>js/css.js">
        </script>
        <script type="text/javascript" src="<?php echo $sitepath?>js/sifr.js">
        </script>
        <script type="text/javascript" src="<?php echo $sitepath?>js/behaviour.js">
        </script>
        <style type="text/css">
        </style>
        <meta name="description" content="<?php echo isset($mediaDescription)?$mediaDescription:"YOUR DESCRIPTION"; ?>">
        <meta name="keywords" content="<?php echo isset($mediaKeywords)?$mediaKeywords:"YOUR KEYWORDS"; ?>">
        <title><?php echo $s_header?><?php echo getSetting("sitename", $db)?> - <?php echo getSetting("sitetitle",
        	 $db)?></title>
        <?php 
        if ($_GET['id'] >= 100) {
        	
        ?>
        <link href="<?php echo $path;?>templates/default/admin.css" rel="stylesheet" type="text/css" />
        <?php 
        }
        ?>
        <link href="<?php echo $path;?>templates/<?php echo $site_template?>/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript">
            <!--
            //--><![CDATA[//><!--
            try {
                document.execCommand("BackgroundImageCache", false, true);
            } 
            catch (err) {
            }//--><!]]>
        </script>
    </head>
    <body>
        <div id="header">
            <div class="wrapper">
<?php echo $headerad?>
                <a id="logo" href="" title="Home">
                    Logo text here
                </a>
                <ul id="tab-menu" class="no-format">
                    <li<?php if ($_GET['id'] == 1) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>">
                                Home
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 2) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>top_rated">
                                Top Rated
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 3) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>most_viewed">
                                Popular
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 88) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>members">
                                Members
                            </a>
                        </span>
                    </li>
                    <li<?php if ($_GET['id'] == 19) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>groups">
                                Groups
                            </a>
                        </span>
                    </li>
                    <?php 
                    if ($loggedIn) {
                    	
                    ?>
                    <li>
                        <span>
                            <a href="<?php echo $path;?>logout">
                                Log Out
                            </a>
                        </span>
                    </li>
                    <?php 
                    }
                    else {
                    	
                    ?>
                    <li<?php if ($_GET['id'] == 6) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>register">
                                Register
                            </a>
                        </span>
                    </li>
                    <?php 
                    }
                    ?>
                    <li<?php if ($_GET['id'] == 5) { echo " class=\"crt\""; } ?>>
                        <span>
                            <a href="<?php echo $path;?>upload">
                                Upload
                            </a>
                        </span>
                    </li>
                </ul>
            </div>
        </div>
        <?php 
        if (!checkBan($_SERVER['REMOTE_ADDR']) > 0) {
        	
        ?>
        <div id="sub-bar">
            <div class="wrapper">
                <div id="top-search">
<?php echo searchBox()?>
                </div>
            </div>
        </div>
        <div id="content-area">
            <div id="main-col">
<?php include_once ("templates/".$site_template."/modules/content.module")?>
            </div>
            <div id="right-col">
                <div class="inner">
                    <?php 
                    if (($loggedIn) && (($_SESSION['username']) != '')) {
                    	if ((!$accountManagementPage) || (getSetting("accountpageon", $db) == 0)) {
                    		
                    ?>
                    <div id="right-top-wrap">
                        <div id="login-box">
                            <h2>
                                Menu
                            </h2>
                            Logged in as <?php echo $_SESSION['username']; ?>
                            <ul>
                                <li>
                                    <a href="<?php echo $sitepath?>account">
                                        <b>Account Management</b>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/inbox">
                                        Inbox : <?php echo $numMessages?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/outbox">
                                        Outbox : <?php echo $numSentMessages?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/myfriends">
                                        My Friends : <?php echo $approvedFriends?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/myreceivedrequests">
                                        Received Requests : <?php echo $receivedRequests?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/mysentrequests">
                                        Sent Requests : <?php echo $sentRequests?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/blocked">
                                        Blocked Members : <?php echo $numBlocked?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/subscriptions">
                                        Subscriptions : <?php echo $numSubs?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/favorites">
                                        Favorites : <?php echo $numFavorites?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/media">
                                        My Media : <?php echo $numMedia?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/managegroups">
                                        My Groups : <?php echo $numGroups?>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/profile?>">
                                        My Profile
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/history">
                                        History
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo $sitepath?>usermenu/profilehistory">
                                        Profile Views
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <?php 
                    }
                    }
                    else {
                    	
                    ?>
                    <div id="right-top-wrap">
                        <form method="post" action="<?php echo $sitepath?>includes/login.php">
                            <div id="login-box">
                                <h2>
                                    log in
                                </h2>
                                <?php 
                                if (isset($_SESSION['loginerr'])) {
                                	echo "<h4>".$_SESSION['loginerr']."</h4><br>";
                                	unset($_SESSION['loginerr']);
                                }
                                ?>
                                <h4>
                                    username
                                </h4>
                                <div class="login-field">
                                    <input tabindex="1" value="" name="user" type="text" class="field" />
                                </div>
                                <h4>
                                    password
                                </h4>
                                <div class="login-field">
                                    <input tabindex="1" name="pass" type="password" class="field" />
                                </div>
                                <div id="lost-passw">
                                    <a href="<?php echo $sitepath?>forgot" title="Click here to recover your password">
                                        <u>
                                            Lost Password ?
                                        </u>
                                    </a>
                                    <input value="log in" name="" type="submit" id="login-btn" />
                                </div>
                                <p>
                                    No account yet ? 
                                    <a href="<?php echo $sitepath?>register" title="Click here to create new account">
                                        <u>
                                            Register
                                        </u>
                                    </a>
                                </p>
                                <label>
                                    <input name="" type="checkbox" value="" />Remember me
                                </label>
                            </div>
                        </form>
                    </div><?php } ?><? eval(menuBlocks()); ?>
                    <div id="right-col-content">
                        <div class="spacing">
                            <a href="<?=$sitepath?>news/">
                                <h2>
                                    <img border=0 src="<?=templateimagepath()?>icn_categories.jpg" alt="" />News 
                                </h2>
                            </a>
                            <br/>
                            <br/>
                            <? 
                            $toEcho = ReturnSideBarNews();
                            echo $toEcho;
                            ?>
                        </div>
<? include_once "templates/".$site_template."/modules/tags.module"; ?><? include_once "templates/".$site_template."/modules/showfriendsbar.module"; ?><?= $adblock1?>
                    </div>
                </div>
            </div>
            <?php 
            }
            else {
            	
            ?>
            <div id="sub-bar">
                <div class="wrapper">
                </div>
            </div>
            <div id="content-area">
                <div id="main-col" align=center>
                    <h1>
                        <b>You have been banned by admin</b>
                    </h1>
                </div>
            </div>
            <?php 
            }
            ?>
            <div id="copyright-bar">
                <div class="wrapper">
<?php echo getCopyrightMessage()?> | <b>
                    <a href="<?=$sitepath."rss.php"?>">
 Rss Feed
                    </a>
                </div>
            </div>
            <div id="footer">
            </div>
            </body>
        </html>
 
This line seems to be where the content gets added in,
PHP:
<?php include_once ("templates/".$site_template."/modules/content.module")?>
Unfortunately, that doesn't let us edit things. The content may be stored in a database, which makes this hard to do.

Here's some JavaScript to add the target attribute to all links on the page inside the main content area. You can place the code in a file then include it on the page. I'd add it just before the end of the head tag (the line with </head>).
PHP:
function ModifyLinksTarget() {
  var links = document.getElementById('main-col');
  var num = links.length;
  do { links[--num].target = '_blank'; } while (num > 0);
}
function appendOnLoad(fx) { 
  try { // For browsers that know DOMContentLoaded (FF, Safari, Opera)
    document.addEventListener("DOMContentLoaded", fx, false);
  } catch(e) {
    var old = window.onload;
    if (typeof old != 'function') { window.onload = fx; }
    else { window.onload = function() { old(); fx(); } }
  }
}
appendOnLoad(ModifyLinksTarget);
 
Nope no luck on that all the links just opened in the same window like always. I really appreciate the help though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.