gazaweb
12-08-2010, 01:07 PM
Hey all!
i came here last time for help and i though i got good service :D
so i haz a new problem :D
ok
i have a script called 'redirect.php' and its linked to my forum, now, when some one clicks a 'external link' they will be taken to the redirect script in the following fashion
Example Link: http://google.co.uk
transforms to
http://bouncy-soundz.info/redirect.php?http://google.co.uk
simples really, BUT i want to BAN some links redirecting out!
so say i wanted google banned, i want them to be taken to a 'THIS PAGE IS BANZORD' or summint :P
the code!
redirect.php
<?php
/*
Example Useage:
<script src="/public/js/hide.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
protected_links = "url.com, url2.com";
auto_anonymize();
//--></script>
________ _____ __________ _____
/ _____/ / _ \ \____ / / _ \
/ \ ___ / /_\ \ / / / /_\ \
\ \_\ \/ | \/ /_/ | \
\______ /\____|__ /_______ \____|__ /
\/ \/ \/ \/
_____ ____________________ _________
/ _ \\______ \______ \/ _____/
/ /_\ \| ___/| ___/\_____ \
/ | \ | | | / \
\____|__ /____| |____| /_______ /
\/ \/
*/
/************************************************************************/
/* Redirector Script codded by Gaza for Bouncy Soundz Radio */
/************************************************************************/
/* redirect.php */
/************************************************************************/
define( 'IPB_THIS_SCRIPT', 'public' );
require_once( './initdata.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
?>
<?
//**********************************************************//
function tpl ($template)
{
if (file_exists ('public/redirect/templates/' . $template . '.html'))
{
include 'public/redirect/templates/' . $template . '.html';
}
}
function logfile ()
{
global $link_url;
global $config;
if ($config['log'] == 1)
{
$fp = fopen ('public/redirect/logs/index.html', 'a');
fwrite ($fp, 'Forwarded to: <B>' . $link_url . '</b> - IP of User: <b>' . $_SERVER['REMOTE_ADDR'] . '</b> - Referrer: <b>' . $_SERVER['HTTP_REFERER'] . '</b> - User Agent: <b>' . $_SERVER['HTTP_USER_AGENT'] . '</b> Timestamp: <b>' . date("l jS \of F g:i A.", time()) . '</b><br /><br />
');
fclose ($fp);
}
}
$config['prcl'] = '';
$config['time'] = 7;
$config['log'] = 1;
$link_url = $_SERVER['QUERY_STRING'];
if ($link_url != '')
{
if (substr ($link_url, 0, 7) != '')
{
$link_url = $link_url;
}
$link_head = $link_url;
$link_time = $config['time'];
logfile ();
tpl ('page_redirect');
exit ();
}
tpl ('page');
exit ();
?>
page_redirect.html
<?
global $link_head;
global $link_time;
//BANNZORD SITES =D
$banned_sites = array('google', 'youtube', 'facebook');
$site = $link_head;
$get_banned = $banned_sites;
$pos = strpos($site, $get_banned);
//CODEY BITS =P
if ($pos === true) {
echo "This site is in our ban list and you are NOT allowed to redirect through our site!";
} else {
?>
<html>
<!--
________ _____ __________ _____
/ _____/ / _ \ \____ / / _ \
/ \ ___ / /_\ \ / / / /_\ \
\ \_\ \/ | \/ /_/ | \
\______ /\____|__ /_______ \____|__ /
\/ \/ \/ \/
_____ ____________________ _________
/ _ \\______ \______ \/ _____/
/ /_\ \| ___/| ___/\_____ \
/ | \ | | | / \
\____|__ /____| |____| /_______ /
\/ \/
-->
<head>
<title>You are now leaving Bouncy Soundz and going to <?=$link_head?> in <?=$link_time?> seconds</title>
<meta http-equiv="refresh" content="<?=$link_time?>; URL=<?=$link_head?>">
<link rel="shortcut icon" href='http://bouncy-soundz.info/favicon.ico' />
<LINK REL='StyleSheet' HREF="/public/style_css/css_6/ipb_styles.css" TYPE="text/css" MEDIA='screen'>
<LINK REL='StyleSheet' HREF="/public/style_css/css_6/ipb_common.css" TYPE="text/css" MEDIA='screen'>
<script type="text/javascript">
window.onload = function() {
startCountDown(7, 1000, myFunction);
var finishedmsg = "Redirecting...";
}
function startCountDown(i, p, f) {
var pause = p;
var fn = f;
var countDownObj = document.getElementById("countDown");
if (countDownObj == null) {
alert("Countdown Dissabled");
return;
}
countDownObj.count = function(i) {
countDownObj.innerHTML = i;
if (i == 0) {
fn();
return;
}
setTimeout(function() {
countDownObj.count(i - 1);
},
pause
);
}
countDownObj.count(i);
}
function myFunction() {
}
</script>
</head>
<body id="ipboard_body">
<div id='ipbwrapper'>
<div id="header">
<!-- Logo -->
<div id="feature_logo">
<a href='/' rel="home" accesskey='1'><img src='http://bouncy-soundz.info/uploads/images/BOUNCY-SOUNDZ-1290979587-U1.png' alt='Bouncy Soundz Logo' /></a>
</div>
</div><br />
<!-- [END]Logo -->
<div id='content' class='clear'>
<h3 class='maintitle' />You are now leaving Bouncy Soundz</h3><br />
<center>
You are now leaving Bouncy Soundz and going to:<br /><br />
<h2><a href='<?=$link_head?>' /><?=$link_head?></a></h2><br />
Time Left: <div id="countDown">Loading...</div>
<p><span class="bbc_right"><span style="font-size: 9px;">Powered by <a href='http://bouncy-soundz.info' />Bouncy Soundz</a></span></span></p>
</div>
<div id='content' class='clear'>
<center>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-0867181130243716";
/* BS LEAVING 2 */
google_ad_slot = "7473953677";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div>
<center><small><font color='#ffffff' />© <a href='http://bouncy-soundz.info/index.php/user/1-dj-gaza/' />Gaza Apps</a> 2010 | Coded by <a href='http://bouncy-soundz.info/index.php/user/1-dj-gaza/' />DJ Gaza</a> | <a href='http://bouncy-soundz.info' />Bouncy Soundz</a></font></small></center>
</body>
</html>
<?
}
?>
now if you can help and come up with a soloution to where im going wrong, it would be GREAT!!!
i came here last time for help and i though i got good service :D
so i haz a new problem :D
ok
i have a script called 'redirect.php' and its linked to my forum, now, when some one clicks a 'external link' they will be taken to the redirect script in the following fashion
Example Link: http://google.co.uk
transforms to
http://bouncy-soundz.info/redirect.php?http://google.co.uk
simples really, BUT i want to BAN some links redirecting out!
so say i wanted google banned, i want them to be taken to a 'THIS PAGE IS BANZORD' or summint :P
the code!
redirect.php
<?php
/*
Example Useage:
<script src="/public/js/hide.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
protected_links = "url.com, url2.com";
auto_anonymize();
//--></script>
________ _____ __________ _____
/ _____/ / _ \ \____ / / _ \
/ \ ___ / /_\ \ / / / /_\ \
\ \_\ \/ | \/ /_/ | \
\______ /\____|__ /_______ \____|__ /
\/ \/ \/ \/
_____ ____________________ _________
/ _ \\______ \______ \/ _____/
/ /_\ \| ___/| ___/\_____ \
/ | \ | | | / \
\____|__ /____| |____| /_______ /
\/ \/
*/
/************************************************************************/
/* Redirector Script codded by Gaza for Bouncy Soundz Radio */
/************************************************************************/
/* redirect.php */
/************************************************************************/
define( 'IPB_THIS_SCRIPT', 'public' );
require_once( './initdata.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
?>
<?
//**********************************************************//
function tpl ($template)
{
if (file_exists ('public/redirect/templates/' . $template . '.html'))
{
include 'public/redirect/templates/' . $template . '.html';
}
}
function logfile ()
{
global $link_url;
global $config;
if ($config['log'] == 1)
{
$fp = fopen ('public/redirect/logs/index.html', 'a');
fwrite ($fp, 'Forwarded to: <B>' . $link_url . '</b> - IP of User: <b>' . $_SERVER['REMOTE_ADDR'] . '</b> - Referrer: <b>' . $_SERVER['HTTP_REFERER'] . '</b> - User Agent: <b>' . $_SERVER['HTTP_USER_AGENT'] . '</b> Timestamp: <b>' . date("l jS \of F g:i A.", time()) . '</b><br /><br />
');
fclose ($fp);
}
}
$config['prcl'] = '';
$config['time'] = 7;
$config['log'] = 1;
$link_url = $_SERVER['QUERY_STRING'];
if ($link_url != '')
{
if (substr ($link_url, 0, 7) != '')
{
$link_url = $link_url;
}
$link_head = $link_url;
$link_time = $config['time'];
logfile ();
tpl ('page_redirect');
exit ();
}
tpl ('page');
exit ();
?>
page_redirect.html
<?
global $link_head;
global $link_time;
//BANNZORD SITES =D
$banned_sites = array('google', 'youtube', 'facebook');
$site = $link_head;
$get_banned = $banned_sites;
$pos = strpos($site, $get_banned);
//CODEY BITS =P
if ($pos === true) {
echo "This site is in our ban list and you are NOT allowed to redirect through our site!";
} else {
?>
<html>
<!--
________ _____ __________ _____
/ _____/ / _ \ \____ / / _ \
/ \ ___ / /_\ \ / / / /_\ \
\ \_\ \/ | \/ /_/ | \
\______ /\____|__ /_______ \____|__ /
\/ \/ \/ \/
_____ ____________________ _________
/ _ \\______ \______ \/ _____/
/ /_\ \| ___/| ___/\_____ \
/ | \ | | | / \
\____|__ /____| |____| /_______ /
\/ \/
-->
<head>
<title>You are now leaving Bouncy Soundz and going to <?=$link_head?> in <?=$link_time?> seconds</title>
<meta http-equiv="refresh" content="<?=$link_time?>; URL=<?=$link_head?>">
<link rel="shortcut icon" href='http://bouncy-soundz.info/favicon.ico' />
<LINK REL='StyleSheet' HREF="/public/style_css/css_6/ipb_styles.css" TYPE="text/css" MEDIA='screen'>
<LINK REL='StyleSheet' HREF="/public/style_css/css_6/ipb_common.css" TYPE="text/css" MEDIA='screen'>
<script type="text/javascript">
window.onload = function() {
startCountDown(7, 1000, myFunction);
var finishedmsg = "Redirecting...";
}
function startCountDown(i, p, f) {
var pause = p;
var fn = f;
var countDownObj = document.getElementById("countDown");
if (countDownObj == null) {
alert("Countdown Dissabled");
return;
}
countDownObj.count = function(i) {
countDownObj.innerHTML = i;
if (i == 0) {
fn();
return;
}
setTimeout(function() {
countDownObj.count(i - 1);
},
pause
);
}
countDownObj.count(i);
}
function myFunction() {
}
</script>
</head>
<body id="ipboard_body">
<div id='ipbwrapper'>
<div id="header">
<!-- Logo -->
<div id="feature_logo">
<a href='/' rel="home" accesskey='1'><img src='http://bouncy-soundz.info/uploads/images/BOUNCY-SOUNDZ-1290979587-U1.png' alt='Bouncy Soundz Logo' /></a>
</div>
</div><br />
<!-- [END]Logo -->
<div id='content' class='clear'>
<h3 class='maintitle' />You are now leaving Bouncy Soundz</h3><br />
<center>
You are now leaving Bouncy Soundz and going to:<br /><br />
<h2><a href='<?=$link_head?>' /><?=$link_head?></a></h2><br />
Time Left: <div id="countDown">Loading...</div>
<p><span class="bbc_right"><span style="font-size: 9px;">Powered by <a href='http://bouncy-soundz.info' />Bouncy Soundz</a></span></span></p>
</div>
<div id='content' class='clear'>
<center>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-0867181130243716";
/* BS LEAVING 2 */
google_ad_slot = "7473953677";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div>
<center><small><font color='#ffffff' />© <a href='http://bouncy-soundz.info/index.php/user/1-dj-gaza/' />Gaza Apps</a> 2010 | Coded by <a href='http://bouncy-soundz.info/index.php/user/1-dj-gaza/' />DJ Gaza</a> | <a href='http://bouncy-soundz.info' />Bouncy Soundz</a></font></small></center>
</body>
</html>
<?
}
?>
now if you can help and come up with a soloution to where im going wrong, it would be GREAT!!!