-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvisit.php
65 lines (62 loc) · 3.9 KB
/
visit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
// $Id: visit.php 11158 2013-03-05 14:10:36Z zyspec $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
include dirname(dirname(__DIR__)) . '/mainfile.php';
include_once __DIR__ . '/class/utility.php';
//xoops_load('utility', $xoopsModule->getVar('dirname'));
$lid = MylinksUtility::mylinks_cleanVars($_GET, 'lid', 0, 'int', array('min' => 0));
if (empty($lid)) {
header('Location: ' . XOOPS_URL . '/');
exit();
}
$cid = MylinksUtility::mylinks_cleanVars($_GET, 'cid', 0, 'int', array('min' => 0));
if (!$xoopsUser || (!$xoopsUser->isAdmin($xoopsModule->mid()))
|| ($xoopsUser->isAdmin($xoopsModule->mid())
&& $xoopsModuleConfig['incadmin'])
) {
$sql = sprintf('UPDATE %s SET hits = hits+1 WHERE lid = %u AND status > 0', $xoopsDB->prefix('mylinks_links'), $lid);
$xoopsDB->queryF($sql);
}
$result = $xoopsDB->query('SELECT url FROM ' . $xoopsDB->prefix('mylinks_links') . " WHERE lid={$lid} AND status>0");
list($url) = $xoopsDB->fetchRow($result);
if (empty($url)) {
header('Location: ' . XOOPS_URL . '/');
exit();
}
$url = htmlspecialchars(preg_replace('/javascript:/si', 'java script:', $url), ENT_QUOTES);
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>\n" . '<title>' . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "</title>\n" . "</head>\n" . "<iframe rows='70px,100%' cols='*' border='0' frameborder='0' framespacing='0' >\n"
. "<iframe src='myheader.php?url={$url}&cid={$cid}&lid={$lid}' frame name='xoopshead' scrolling='no' target='main' Noresize>\n" . "<iframe src='{$url}' frame name='main' scrolling='auto' target='Main'>\n" . "</iframe></html>\n";
} else {
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL={$url}\"></meta></head><body></body></html>";
}
exit();