Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > PHP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 19-05-2010
CniL CniL is offline
Miembro
 
Registrado: may 2010
Posts: 10
Poder: 0
CniL Va por buen camino
Noticias con tiempo limitado

2 archivo
shownoti.php y noticias.php

una vez ya conectado a tu BD
imagina una tabla en la BD con
ID/FECHA/NOTICIA/LINK
------------------------
1 / 2010-05-18 / Acá la noticia / Link relacionado con la noticia
2 / otra fecha / otra noticia / otro link
ETC...

shownoti.php
Código PHP:
        <?php //CONSULTA SI HAN PASADO 3 DIAS DE ULTIMA NOTICIA
              
$consulta=mysql_query("SELECT fecha FROM noticias ORDER BY id DESC LIMIT 1");
            
$datos=mysql_fetch_array($consulta);
            
$fnoti=$datos['fecha'];
            
$fhoy=date ("Y-m-d");
            
$dias=diferenciafechas($fhoy,$fnoti);
            if(
$dias<3)
            {
        
?>
        <div id="noticias">
        <?php include("noticias.php");?>
        </div><!-- FIN NOTICIAS -->
        <?php
            
}
        
?>
noticias.php
Código PHP:
<?php
  $seleccion
="SELECT fecha,autor,titulo,noticia,link FROM noticias ORDER BY id DESC LIMIT 1" ;
  
$consulta=mysql_query($seleccion,$conn);
  
$datos=mysql_fetch_array($consulta,$seleccion_db);
  
?>
<h3><strong>Noticia:</strong></h3>
<h4><strong>Título</strong>: "<?php if($datos['link']){?><a href='<?php echo $datos['link']?>'><?php echo $datos['titulo'];?>"</a><?php }else{ echo $datos['titulo'];?>"<?php ?></h4><hr>
<h5><?php echo $datos['noticia'];?></h5><hr>
<h6><strong>Escrito por</strong> <i><?php echo $datos['autor'];?></i> /<strong> El Día</strong> <i><?php echo $datos['fecha'];?></i></h6>
Responder Con Cita
  #2  
Antiguo 19-05-2010
CniL CniL is offline
Miembro
 
Registrado: may 2010
Posts: 10
Poder: 0
CniL Va por buen camino
Donde está el dias<3 es donde pones la cantidad de días que dure la noticia ONLINE

es para BD MYSQL
Responder Con Cita
  #3  
Antiguo 19-05-2010
Avatar de movorack
[movorack] movorack is offline
Miguel A. Valero
 
Registrado: feb 2007
Ubicación: Bogotá - Colombia
Posts: 1.346
Poder: 20
movorack Va camino a la famamovorack Va camino a la fama
????????

tutorial? truco? duda? problema?
__________________
Buena caza y buen remar... http://mivaler.blogspot.com
Responder Con Cita
  #4  
Antiguo 20-05-2010
CniL CniL is offline
Miembro
 
Registrado: may 2010
Posts: 10
Poder: 0
CniL Va por buen camino
Cita:
Empezado por movorack Ver Mensaje
????????

tutorial? truco? duda? problema?
Compartiendo
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Grabar en registro y directorio Windows como usuario limitado alquimista API de Windows 19 26-01-2008 16:04:01
Acceso Limitado Lorenzo07 Conexión con bases de datos 9 27-06-2007 23:14:20
Query limitado? jam888 Varios 2 20-04-2006 20:04:59
Memo limitado. ALMERA OOP 7 08-10-2003 02:00:48
Noticias verídicas obiwuan Humor 2 13-06-2003 21:39:36


La franja horaria es GMT +2. Ahora son las 00:52:56.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi