source: temp/test-xoops.ec-cube.net/html/modules/mylinks/visit.php @ 405

Revision 405, 3.5 KB checked in by root, 20 years ago (diff)
Line 
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//  ------------------------------------------------------------------------ //
27include '../../mainfile.php';
28$lid = intval($_GET['lid']);
29if (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");
37list($url) = $xoopsDB->fetchRow($result);
38if (empty($url)) {
39    header('Location: '.XOOPS_URL.'/');
40    exit();
41}
42$url = htmlspecialchars(preg_replace( '/javascript:/si' , 'java script:', $url ), ENT_QUOTES);
43if ( $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&amp;cid=$cid&amp;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}
60exit();
61
62?>
Note: See TracBrowser for help on using the repository browser.