phpDocumentor NewsCMS
[ class tree: NewsCMS ] [ index: NewsCMS ] [ all elements ]

Source for file headliner.php

Documentation is available at headliner.php


1 <?
2 function htmltext($text) {
3 $text = ereg_replace("%", "&#37;", $text);
4 $text = ereg_replace("\"", "&quot;", $text);
5 $text = ereg_replace("'", "&#39;", $text);
6 return $text;
7 }
8
9 if (!$h) {
10 $h = 2;
11 }
12 $host = "http://www.northcountrypublicradio.org/news_mirror.php";
13 $fd = fopen ("$host", "r");
14 while (!feof ($fd)) {
15 $buffer = fread($fd, 1000000);
16 }
17 if (strstr($buffer, "<!--HL1-->")) {
18 echo 'document.write(\'<div class="headline_header"><img src="images/ncprorgsm.gif" hspace="0" width="51" height="12" align="absmiddle">&nbsp;TOP STORIES:</div>';
19 for ($i=1;$i<=$h;$i++) {
20 if (strstr($buffer, "<!--HL$i-->")) {
21 //if ($i>1) echo '<br>';
22 $all_content = strstr($buffer, "<!--HL$i-->");
23 $chr_content = strpos($buffer, strstr($buffer, "<!--END_HL$i-->"))
24 - strpos($buffer, strstr($buffer, "<!--HL$i-->"));
25 $content = substr("$all_content", 0, $chr_content);
26 echo '<div class="headline"><a href="http://www.northcountrypublicradio.org/news.php?'.date("Ymd").$i.'#hl'.$i.'"';
27 if ($newwindow=="1") echo ' target="_blank"';
28 echo '>'.htmltext($content).'</a></div>';
29 }
30 }
31 echo '\')';
32 }
33 else {
34 echo 'document.write(\'<div class="headline_header"><img src="images/ncprorgsm.gif" hspace="0" width="51" height="12" align="absmiddle">&nbsp;TOP STORIES:</div><a href="http://www.northcountrypublicradio.org/news.php">Visit the NCPR Online Weekend News Magazine</a>\')';
35 }
36 fclose ($fd);
37 ?>

Documentation generated on Wed, 19 Nov 2003 22:51:53 -0500 by phpDocumentor 1.2.3