Blame view

sm/misc.func.php 1.02 KB
42868d70   andryeyev   Создал GIT
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
  <?php
  // PHP xml sitemap generator
  
  // this function generates and returns the xml sitemap at the end of the spidering process
  function genXmlSitemap() {
          global $SPIDER, $CONFIG;
  
          $data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
          <urlset
            xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
            xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
            xsi:schemaLocation=\http://www.google.com/schemas/sitemap/0.84
                        http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
  
          for($i = 0; $i < sizeof($SPIDER["spider"]); $i++) {
                  $data .= "<url>\n\t<loc>".$SPIDER["spider"][$i]."</loc>\n\t<priority>".$CONFIG["priority"]."</priority>\n</url>\n";
          }
  
          $data .= "</urlset>";
          return $data;
  }
  
  // case insensitive version of strpos ( used for compatibility with php4 )
  function strposi($string, $needle) {
          $istr = strtolower($string);
          $ineedle = strtolower($needle);
          return strpos($istr, $ineedle);
  }
  
  
  ?>