sma-website /search/viewcache.php

Language PHP Lines 148
MD5 Hash 9fb3e5ad1a24cfc905093a5911fcc86d Estimated Cost $2,005 (why?)
Repository https://bitbucket.org/molusc/sma-website.git View Raw File
  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
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php

/******************************************************************************
 * iSearch2 - website search engine                                           *
 *                                                                            *
 * Visit the iSearch homepage at http://www.iSearchTheNet.com/isearch         *
 *                                                                            *
 * Copyright (C) 2002-2007 Z-Host. All rights reserved.                       *
 *                                                                            *
 ******************************************************************************/

// PHPLOCKITOPT NOENCODE

$isearch_path = dirname(__FILE__);
define('IN_ISEARCH', true);

require_once "$isearch_path/inc/core.inc.php";

/* Open the search component (read only) */
isearch_open(True);

$isearch_pageTitle = $isearch_lang['viewcache_title'];

/* Display the frame set */

echo <<<EOF

EOF;

$frame = isset($_REQUEST['frame']) ? $_REQUEST['frame'] : '';
$url = isset($_REQUEST['url']) ? $_REQUEST['url'] : '';

if ($frame == '')
{
    /* Display the frame set */

    echo '

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $isearch_languageCode . '">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset='.$isearch_config['char_set'].'" />
        <title>' . $isearch_pageTitle . '</title>
        <meta name="author" content="Ian Willis" />
        <meta name="copyright" content="Copyright Z-Host. All rights reserved." />
        <meta name="robots" content="noindex,nofollow" />
        <link rel="stylesheet" href="'.$isearch_config['base_url'].'/style/'.$isearch_config['style_name'].'.css" type="text/css" />
    </head>

    <frameset cols="100%" rows="100,*" >
        <frame frameborder="0" src="viewcache.php?frame=top&amp;url=' . $url . '" />
        <frame frameborder="0" src="viewcache.php?frame=bottom&amp;url=' . $url . '" />
    </frameset>

    <noframes>
        <body>
';

    include "$isearch_path/inc/header.inc.php";

    echo <<<EOF

            <h3>Sorry, you are unable to view cache contents - your browser does not support frames.</h3>

EOF;

    include "$isearch_path/inc/footer.inc.php";

    echo <<<EOF

        </body>
    </noframes>

</html>

EOF;
}
else if ($frame == 'top')
{
    /* Display the top frame (message saying that this page is cached) */
    echo '

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $isearch_languageCode . '">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset='.$isearch_config['char_set'].'" />
        <title>' . $isearch_pageTitle . '</title>
        <meta name="author" content="Ian Willis" />
        <meta name="copyright" content="Copyright Z-Host. All rights reserved." />
        <meta name="robots" content="noindex,nofollow" />
        <link rel="stylesheet" href="'.$isearch_config['base_url'].'/style/'.$isearch_config['style_name'].'.css" type="text/css" />
    </head>

    <body>

';

    include "$isearch_path/inc/header.inc.php";

    echo <<<EOF

        <h1 class="isearch">$isearch_pageTitle</h1>

EOF;

    $isearch_cachedpage = preg_replace("/(%u)/", "<a href=\"$url\">$url</a>", $isearch_lang['cachedpage']);

    echo '
        <h2 class="isearch-cachedpage">' . $isearch_cachedpage . '</h2>
';
    include "$isearch_path/inc/footer.inc.php";

    echo <<<EOF

    </body>

</html>

EOF;
}
else if ($frame == 'bottom')
{
    /* Display the cached page */

    $result = mysql_query ("SELECT cache, base FROM $isearch_table_urls WHERE url='$url'", $isearch_db);
    if (($result) && ($resultItem = mysql_fetch_object($result)))
    {
        $cache = $resultItem->cache;
        if (!eregi("<head>.*<base .*></head>", $cache))
        {
            /* Insert a base tag into the head of this cached page */
            $base = $resultItem->base;
            $cache = eregi_replace("</head>", "<base href=\"$base\" />\n</head>", $cache);
        }
        echo $cache;
    }
}

/* Close the search component */
isearch_close();


?>
Back to Top