Commit 87569c6a16815b724dcd42728a74c10ba4638694

Authored by Edmar Moretti
1 parent 20b6ef5f

Criação de programa para geração de RSS contento a lista de temas disponíveis para download

Showing 2 changed files with 47 additions and 0 deletions   Show diff stats
admin/php/xml.php
... ... @@ -82,6 +82,28 @@ function geraXmlGeorss($locaplic)
82 82 $sql = "select * from i3geoadmin_ws where tipo_ws = 'GEORSS' and nome_ws <> ''";
83 83 return geraXmlRSS($locaplic,$sql,"Georss");
84 84 }
  85 +function geraRSStemasDownload($locaplic)
  86 +{
  87 + $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']);
  88 + $url = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].(str_replace("/admin/rsstemasdownload.php","",$_SERVER['PHP_SELF']));
  89 + $sql = "select '".$url."/datadownload.htm?'||codigo_tema as link_ws, g.nome_grupo||' -> '||sg.nome_subgrupo||' -> '||nome_tema as nome_ws, desc_tema as desc_ws, link_tema as autor_ws ";
  90 + $sql .= "
  91 + from i3geoadmin_temas as t,i3geoadmin_n3 as n3, i3geoadmin_n2 as n2, i3geoadmin_n1 as n1, i3geoadmin_grupos as g, i3geoadmin_subgrupos as sg
  92 + where
  93 + t.id_tema = n3.id_tema
  94 + and n3.id_n2 = n2.id_n2
  95 + and n2.id_subgrupo = sg.id_subgrupo
  96 + and n2.id_n1 = n1.id_n1
  97 + and n1.id_grupo = g.id_grupo
  98 + and (t.download_tema = 'sim' or t.download_tema = 'SIM')
  99 + and n3.n3_perfil = ''
  100 + and n2.n2_perfil = ''
  101 + and n1.n1_perfil = ''
  102 + ";
  103 + //echo $sql;exit;
  104 + return geraXmlRSS($locaplic,$sql,"Temas para download");
  105 +}
  106 +
85 107 function geraXmlRSS($locaplic,$sql,$descricao)
86 108 {
87 109 $dbh = "";
... ...
admin/rsstemasdownload.php 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +<?php
  2 +error_reporting(0);
  3 +if(!isset($locaplic))
  4 +{
  5 + $locaplic = "";
  6 + if(file_exists("../../../ms_configura.php"))
  7 + {include_once("../../../ms_configura.php");}
  8 + else
  9 + {
  10 + if(file_exists("../../ms_configura.php"))
  11 + {include_once("../../ms_configura.php");}
  12 + else
  13 + {
  14 + if(file_exists("../ms_configura.php"))
  15 + {include_once("../ms_configura.php");}
  16 + else
  17 + include_once("ms_configura.php");
  18 + }
  19 + }
  20 +}
  21 +include_once($locaplic."/classesphp/pega_variaveis.php");
  22 +include_once($locaplic."/admin/php/xml.php");
  23 +echo header("Content-type: application/xml");
  24 +echo geraRSStemasDownload($locaplic);
  25 +?>
0 26 \ No newline at end of file
... ...