sma-website /search/google_sitemap.php

Language PHP Lines 78
MD5 Hash cbac7aa3a6b1c696a2e7df7c80698867 Estimated Cost $1,236 (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
<?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";
require_once "$isearch_path/inc/search.inc.php";

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

/* Show flat site map (ordered by url) */
$result = mysql_query("SELECT url, lastmod, changefreq, priority FROM $isearch_table_urls ORDER BY url", $isearch_ro_db);
if (!$result)
{
    echo "<p>MySQL error : " . mysql_error() . ' File: ' . __FILE__ . ', Line:' . __LINE__ . "</p>\n";
}
else if (mysql_num_rows($result) > 0)
{

    if ($isearch_config['char_set_8_bit'])
    {
        $trans = get_html_translation_table(HTML_ENTITIES);
    }
    else
    {
        $trans = get_html_translation_table(HTML_SPECIALCHARS);
    }

    echo '<?xml version="1.0" encoding="UTF-8"?>

<!-- Powered by iSearch2                     -->
<!-- http://www.iSearchTheNet.com/isearch    -->

<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
';
    while ($item = mysql_fetch_object($result))
    {
        echo '
  <url>
    <loc>'.strtr($item->url, $trans).'</loc>
';
        if ($item->lastmod > 0)
        {
            echo '    <lastmod>'.date('Y-m-d', $item->lastmod).'T'.date('H:i:s', $item->lastmod).'+00:00</lastmod>
';
        }
        if ($item->changefreq != '')
        {
            echo '    <changefreq>'.$item->changefreq.'</changefreq>
';
        }
        if ($item->priority >= 0)
        {
            echo '    <priority>'.$item->priority.'</priority>
';
        }
        echo '  </url>
';
    }
    echo '
</urlset>
';
}

?>
Back to Top