<?php
// $Id: visit.php,v 1.4 2005/10/28 11:56:02 ohwada Exp $

// 2005-09-04 K.OHWADA
// BUG 2932: dont work correctly when register_long_arrays = off

// 2004-11-28 K.OHWADA
// write fair, delete unnecessary comments

// 2004/08/10 K.OHWADA
// enable to install this module two or more. 

//================================================================
// visit website and count up
// use class weblinksLink
// 2004/01/14 K.OHWADA
//================================================================

include "header_basic.php";

// BUG 2932: dont work correctly when register_long_arrays = off
$lid = intval( $_GET['lid'] );

$tbl_link->countupHits($lid);
$url = $tbl_link->getSaniUrlByLid($lid);

// jump this site, if no url
if ( empty($url) )
{
	redirect_header(XOOPS_URL, 3, _WLS_NOMATCH);
}

$sitename = $xoopsConfig['sitename'];

if ( $xoopsModuleConfig['frame'] != "" ) 
{
	header('Content-Type:text/html; charset='._CHARSET);
	header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header('Cache-Control: no-store, no-cache, must-revalidate');
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");
	echo "<html><head>
		<title>".$sitename."</title>
		</head>
		<frameset rows='70px,100%' cols='*' border='0' frameborder='0' framespacing='0' >
		<frame src='myheader.php?lid=$lid' frame name='xoopshead' scrolling='no' target='main' Noresize>
		<frame src='".$url."' frame name='main' scrolling='auto' target='Main'>
		</frameset></html>";
}
else 
{
	echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=".$url."\"></meta></head><body></body></html>";
}

exit();

?>
