Kirjautuminen

Haku

Tehtävät

Keskustelu: Koodit: PHP: Uutiset digitodaysta

Linkku [18.05.2004 20:20:47]

#

Hakee uutiset digitofaysta ilman mainoksia.
Tekee lähdekoodista melkein luettavaa.(muuttaa tabit välilyönneiksi)
Demonstraatio täällä http://koti.mbnet.fi/linkku-/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fi" xml:lang="fi">
  <head>
    <title>digitodayn uutiset</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link href="tyyli.css" rel="stylesheet" type="text/css" />
  </head>
  <body style="background-color:#909090;">
    <table style="background-color: #ffffff; width: 400px;">
      <tr>
<?php
  $data = file("http://digitoday.fi/showPage.php?page_id=23");

  for($a=99; $a<=193; $a++)
  {
    $s = str_replace("<td colspan=\"5\"><img src=\"pics/1x1.gif\" width=\"1\" height=\"5\"><br></td>","",($data[$a]));
    $s = str_replace("href=\"","href=\"http://www.digitoday.fi/",($s));
    $s = str_replace("<img src=\"","<img src=\"http://www.digitoday.fi/",($s));
    $s = str_replace("\t","  ",($s));
    $s = str_replace(" bgcolor=\"#EAEAEA\""," style=\"background-color: #EAEAEA;\"",($s));
    $s = str_replace("&news","&amp;",($s));
    $s = str_replace("<img src","<img alt=\"\" src",($s));
    $s = str_replace("border=\"0\">","border=\"0\" />",($s));

    echo "$s";
  }

?>
      </tr>
    </table>
  </body>

tyyli.css

a:link {font-weight: normal; color: #005297; text-decoration: none; }
a:active {font-weight: normal; color: #081E30; text-decoration: none; }
a:visited {font-weight: normal; color: #005297; text-decoration: none; }
a:hover   {font-weight: normal; color: #081E30; text-decoration: underline;}
body, td, tr { font-family: Arial, Helvetica, sans-serif;font-size: 11px; font-weight: normal; color: #000000; }
a.n_link:link{font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #005297; text-decoration: none; }
a.n_link:active {font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #081E30; text-decoration: none; }
a.n_link:visited {font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #005297; text-decoration: none; }
a.n_link:hover   {font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #081E30; text-decoration: underline;}

Vastaus

Aihe on jo aika vanha, joten et voi enää vastata siihen.

Tietoa sivustosta