| 1 | <?php |
|---|
| 2 | // $Id: visit.php,v 1.4 2005/08/03 12:39:13 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------ // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | include '../../mainfile.php'; |
|---|
| 28 | $lid = intval($_GET['lid']); |
|---|
| 29 | if (empty($lid)) { |
|---|
| 30 | header('Location: '.XOOPS_URL.'/'); |
|---|
| 31 | exit(); |
|---|
| 32 | } |
|---|
| 33 | $cid = intval($_GET['cid']); |
|---|
| 34 | $sql = sprintf("UPDATE %s SET hits = hits+1 WHERE lid = %u AND status > 0", $xoopsDB->prefix("mylinks_links"), $lid); |
|---|
| 35 | $xoopsDB->queryF($sql); |
|---|
| 36 | $result = $xoopsDB->query("select url from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid and status>0"); |
|---|
| 37 | list($url) = $xoopsDB->fetchRow($result); |
|---|
| 38 | if (empty($url)) { |
|---|
| 39 | header('Location: '.XOOPS_URL.'/'); |
|---|
| 40 | exit(); |
|---|
| 41 | } |
|---|
| 42 | $url = htmlspecialchars(preg_replace( '/javascript:/si' , 'java script:', $url ), ENT_QUOTES); |
|---|
| 43 | if ( $xoopsModuleConfig['frame'] != "" ) { |
|---|
| 44 | header('Content-Type:text/html; charset='._CHARSET); |
|---|
| 45 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
|---|
| 46 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|---|
| 47 | header('Cache-Control: no-store, no-cache, must-revalidate'); |
|---|
| 48 | header("Cache-Control: post-check=0, pre-check=0", false); |
|---|
| 49 | header("Pragma: no-cache"); |
|---|
| 50 | echo "<html><head> |
|---|
| 51 | <title>".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."</title> |
|---|
| 52 | </head> |
|---|
| 53 | <frameset rows='70px,100%' cols='*' border='0' frameborder='0' framespacing='0' > |
|---|
| 54 | <frame src='myheader.php?url=$url&cid=$cid&lid=$lid' frame name='xoopshead' scrolling='no' target='main' Noresize> |
|---|
| 55 | <frame src='".$url."' frame name='main' scrolling='auto' target='Main'> |
|---|
| 56 | </frameset></html>"; |
|---|
| 57 | } else { |
|---|
| 58 | echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=".$url."\"></meta></head><body></body></html>"; |
|---|
| 59 | } |
|---|
| 60 | exit(); |
|---|
| 61 | |
|---|
| 62 | ?> |
|---|