A mi me llevaron topleras para mi cumpleaños en Peloton. ElAntro me cago, y me mostro a mi tambien en pelota.

03-10-2009, 02:21
|
|
Ocios@

|
|
Registrado: Apr 2006
Posts: 323
FoquiMoney: 3.448
Gracias dadas: 6
Agradecido 13 vez en 13 posts
|
|
|
Ayuda En Php
tengo el siguiente problema que me tiene un poco ocupado estos dias.
Estoy haciendo un sistema de noticias, ingresar al index muestra las primeras noticias
creadas con su titular, fecha, nombre del que la creo y un resumen del texto y cuando la habres tendria que aparecer lo mismo y el texto completo en una pantalla diferente, pero no pasa eso, esta abriendo todo en la misma pantalla.
se supone que crea una variable tipo indexnoticias.php?artid=$id, pero aparece la primera parte mas la segunda al precionarla, aqui esta el codigo
todo esto tiene su base de datos y todo los demas, ojala puedan ayudarme
Cita:
<?php
$result = mysql_query ("SELECT article_news.date,article_news.id,article_news.tit le,article_news.intro,author_news.email,author_new s.userid,author_news.fname,author_news.lname FROM article_news,author_news where validated=1 order by article_news.date desc limit 9");
while ($row = mysql_fetch_array($result))
{
$catid = $row["catid"];
$id = $row["id"];
$title = $row["title"];
$date = $row["date"];
$intro = $row["intro"];
$fname = $row["fname"];
$lname = $row["lname"];
$email = $row["email"];
$userid = $row["userid"];
$year=substr($row[date],0,4);
$month=substr($row[date],4,2);
$day=substr($row[date],6,2);
$date = "$day/$month/$year";
$count = $count +1 ;
$t = substr($title,0,20);
print("<font color='#000000' size='3' face='Arial'><a href='indexnoticias.php?artid=$id'><strong>$t</strong></a></font><br>");
echo "Escrito el: $date Por: <a href=mailto:$email><strong>:$row[fname] $row[lname]</strong></a><br>
<br>
";
$in = substr($intro,0);
echo("<font color='#000000' size='2' face='Arial'>$row[intro]</font><br>");
echo "................................................. .................................................. ............................<br>";
settype($artid,"integer");
$sql = "SELECT * FROM article_news,author_news where author_news.userid = article_news.authorid AND id = '$artid'";
$result = mysql_query($sql);
$num_res = mysql_num_rows($result);
for ($i=0; $i<$num_res; $i++)
{
$myrow = mysql_fetch_array($result);
$id = $myrow["id"];
$catid = $myrow["catid"];
$title = $myrow["title"];
$date = $myrow["date"];
$date_changed = $myrow["date"];
$authorid = $myrow["authorid"];
$intro = $myrow["intro"];
$body = $myrow["body"];
$status = $myrow["status"];
$count = $myrow["count"];
$votes = $myrow["votes"];
$grade = $myrow["grade"];
$fname = $myrow["fname"];
$lname = $myrow["lname"];
$userid = $myrow["userid"];
$email = $myrow["email"];
$show_html = $myrow["show_html"];
$year=substr($myrow[date],0,4);
$month=substr($myrow[date],4,2);
$day=substr($myrow[date],6,2);
$tid1 = "$day/$month/$year";
$year2=substr($myrow[date_changed],0,4);
$month2=substr($myrow[date_changed],4,2);
$day2=substr($myrow[date_changed],6,2);
$tid2 = "$day2/$month2/$year2";
$code_table_start = "<table class=\"code\" borderColorDark=\"#000000\"
cellPadding=\"2\" width=\"100%\" bgColor=\"#e4e4fc\" borderColorLight=\"#ffffff\"
border=\"1\"><tr><td width=\"100%\">";
$code_table_end = "</td></tr></table>";
$sql = "SELECT * FROM cat_news where id = $catid";
$result = mysql_query($sql);
$num_res = mysql_num_rows($result);
for ($i=0; $i<$num_res; $i++)
{
$myrow = mysql_fetch_array($result);
$catname = $myrow["catname"];
$id = $myrow["id"];
print "<!-- TEMPLATE FILE -->";
$filename = "admin/art.html";
$fd = fopen ($filename, "r");
$file= fread ($fd, filesize ($filename));
$file = str_replace("{ID}", "$id", $file);
$file = str_replace("{CATNAME}", "$catname", $file);
$file = str_replace("{TITLE}", "$title", $file);
$file = str_replace("{EMAIL}", "$email", $file);
$file = str_replace("{FNAME}", "$fname", $file);
$file = str_replace("{LNAME}", "$lname", $file);
$file = str_replace("{DATE_CHANGED}", "$date_changed", $file);
$file = str_replace("{ARTID}", "$artid", $file);
$file = str_replace("{INTRO}", "$intro", $file);
$file = str_replace("{TID1}", "$tid1", $file);
$file = str_replace("{TID2}", "$tid2", $file);
$file = str_replace("{BODY}", "$body", $file);
$file = str_replace("{LA_BY}", "$la_by", $file);
$file = str_replace("{LA_CHANGED}", "$la_changed", $file);
$file = str_replace("{LA_NEWS}", "$la_news", $file);
$file = str_replace("{LA_PRINT}", "$la_print", $file);
$file = str_replace("{LA_RATE_THIS}", "$la_rate_this", $file);
$file = str_replace("{LA_TELLAFRIEND}", "$la_tellafriend", $file);
echo $file;
}
}
}
?>
|
|

06-10-2009, 19:41
|
|
Ocios@

|
|
Registrado: Apr 2006
Posts: 323
FoquiMoney: 3.448
Gracias dadas: 6
Agradecido 13 vez en 13 posts
|
|
|
Re: Ayuda En Php
No se si me pudieron comprender lo que quiero hacer...
Lo que pasa es que como les comentaba estoy haciendo un sistema de noticias en php y pasa lo siguiente.
En Index.php muestra el Titulo el cual es el Link para ver la noticia completa, quien creo la noticia, la fecha y un resumen de la noticia y al precionar el titulo tienes la opcion de ver la noticia completa, pero lo fome es que tengo que depender de otra pagina.php para poderla ver, siendo que todo lo podria que en index.php pero creando una variable index.php?noticia=artid2, eso es lo que quiero hacer y no puedo, alguna ayuda???
|

23-10-2009, 16:05
|
 |
Ocios@

|
|
Registrado: Apr 2006
Posts: 298
FoquiMoney: 1.796
Gracias dadas: 0
Agradecido 0 vez en 0 posts
|
|
|
Re: Ayuda En Php
para hacer eso necesitas manejar mucho javascript,css(para los div) es solamente llamar a una funcion que cambia el conteniudo de un div
esta funcion te puede servir
se llama con un a href donde le das las variables ej <a href="javascript:cambiarImagen('RUTA DE LA IMAGEN','ALTO','ANCHO','NOTICIA')">
funcion javascript
function CambiarImagen(NuevaImagen,alto,ancho,texto){
document.getElementById("divimagenPro").innerHTML = '<img src="'+NuevaImagen+'" width='+ancho+' height='+alto+' border=0>';
document.getElementById("textoProd").innerHTML =texto;
}
xau espero k te sirva
Editado por ikanuno en 23-10-2009 a las 16:13.
|
Personas en esta discusión: 1 (0 usuario(s) y 1 invitado(s))
|
|
|
Todas las horas son GMT -3. La hora es 09:56.
|
|