%
// incluir librerias
include("config.inc.php3");
//include("../jugadores/config.inc.php3");
// standard header
standar_header();
// se crea el objeto de conexion a la base de datos
$table = new my_dbsearcher;
%>
Federación Colombiana de Golf
<%
$qidj = db_query("SELECT * FROM Jugador WHERE Publicar = 'S' ORDER by Rand()");
$rj = db_fetch_object($qidj);
$ruta="$folder_img_jugadores/$rj->Foto1";
%>
<%
$select="SELECT
m.nombre as mod_nombre,
s.nombre as nom_sec,
m.id_modulo as mod_id,
s.id_seccion as sec_id,
m.path as path ";
$from= " FROM
modulo as m
LEFT JOIN
seccion as s
ON
m.id_modulo = s.id_modulo ";
$where = " WHERE
s.activo = 'S' OR
s.id_modulo is NULL
ORDER BY
m.orden ASC,
s.orden ASC";
$query=$select.$from.$where;
$table->sql_query($query);
$cur_module="";
while ($row = $table->sql_fetch_object()){
if ($cur_module != $row->mod_id) {
$cur_module = $row->mod_id;
%>
<%
$query="SELECT
n.titular,
n.subtitular,
n.fecha_noticia,
n.cuerpo,
n.foto,
n.autor,
n.fuente,
n.id_seccion,
n.id_tipo_news
FROM
news as n
WHERE
n.id_news=$nt AND
n.publicar='S' ";
$table->search($query);
if ($table->nfound) {
$datos=$table->sql_fetch_row();
$titular=$datos[0];
$subtitular=$datos[1];
$fecha=fecha($datos[2]);
$texto=$datos[3];
$foto=$datos[4];
$autor=$datos[5];
$fuente=$datos[6];
$id_seccion=$datos[7];
$tipo=$datos[8];
%><% // no colocar otros titulares si es HTML
if ($tipo != 2) {
%>
<%
// se deben listar todos los titulares de noticias vigentes en las seccion
// excepto la noticia en pantalla
$query = "SELECT
n.id_news as id_news,
n.titular as titular
FROM
news as n
WHERE
n.id_seccion = '$sc' AND
n.id_news != '$nt' AND
n.publicar = 'S' AND
TO_DAYS(n.fecha_inicio) <= TO_DAYS(NOW()) AND
TO_DAYS(n.fecha_fin) >= TO_DAYS(NOW())";
$table->search($query);
// mostrar la tabla solo si hay registros
if ($table->nfound) {
%>
<% } // end if not HTML
%><% if ($subtitular){%><%echo $subtitular%>
<%}%><%echo $titular%>
<% if ($autor){ %>por: <%echo $autor%><% }
if ($fuente)
echo " / ".$fuente %>
<%
if ($foto){
%><%
}
%><%
// reemplazar los cambios de linea por HTML breaks
if ($tipo!='2') $texto=nl2br($texto);
echo "$texto";
%>
<%
}//if nfound
%>
<%
//Vamos a buscar las noticas relacionas con la noticia actual
$query="SELECT
n.titular as titular,
n.id_news as id_news
FROM
news as n,
rel_news as r
WHERE
r.id_news = '$nt' AND
r.id_relnews = n.id_news ";
$table->search($query);
if ($table->nfound){
%>
Noticias Relacionadas
<%
while ($rel_obj=$table->sql_fetch_object()){
%>