gaim/www
Clone
Summary
Browse
Changes
Graph
update
2004-01-10, Luke Schierer
3a0d8e402f14
update
<?php
require
"base.inc.php"
;
start_html
(
"News"
);
?>
<div
align=
"left"
>
<i><font
color=
"#606060"
>
Get
the
news
in
RSS
</font></i>
<a
href=
"/rss.php/news"
><img
src=
"/images/xml.png"
width=
"36"
height=
"14"
border=
"0"
alt=
"XML"
/></a>
</div>
<?php
if
(
!
isset
(
$start
))
{
$start
=
0
;
}
if
(
!
isset
(
$limit
))
{
$limit
=
5
;
}
/* Parse the news. */
$filename
=
"news.txt"
;
$fcontents
=
file
(
$filename
);
$index
=
0
;
$pos
=
0
;
print
"<br />
\n
"
;
while
(
list
(
$linenum
,
$line
)
=
each
(
$fcontents
))
{
if
(
$pos
<
$start
)
{
if
(
chop
(
$line
)
==
"#"
)
{
$pos
++
;
}
continue
;
}
elseif
(
$pos
<
(
$start
+
$limit
))
{
if
(
chop
(
$line
)
==
"#"
)
{
end_section
();
print
"<br />
\n
"
;
$index
=
0
;
$pos
++
;
continue
;
}
elseif
(
$index
==
0
)
{
$cur_title
=
$line
;
}
elseif
(
$index
==
1
)
{
start_section
(
$cur_title
,
$line
);
$cur_title
=
""
;
}
else
{
print
"<p>"
.
$line
.
"</p>
\n
"
;
}
}
else
{
break
;
}
$index
++
;
}
if
(
$index
>
0
)
{
end_section
();
print
"<br />
\n
"
;
}
if
(
$index
==
0
||
$start
>
0
)
{
print
"<table border=
\"
0
\"
width=
\"
100%
\"
>
\n
"
;
print
" <tr>
\n
"
;
print
" <td nowrap=
\"
nowrap
\"
>"
;
if
(
$start
>
0
)
{
print
"<font face=
\"
Verdana, Tahoma, Arial, Helvetica
\"
"
;
print
" size=
\"
-1
\"
>"
;
print
"<a href=
\"
$PHP_SELF
?start="
;
print
((
$start
-
$limit
>
0
)
?
(
$start
-
$limit
)
:
0
);
print
"&limit=
$limit
\"
><- Previous</a>"
;
print
"</font>"
;
}
else
{
print
" "
;
}
print
"</td>
\n
"
;
print
" <td align=
\"
right
\"
nowrap=
\"
nowrap
\"
>"
;
if
(
$index
==
0
)
{
print
"<font face=
\"
Verdana, Tahoma, Arial, Helvetica
\"
"
;
print
" size=
\"
-1
\"
>"
;
print
"<a href=
\"
$PHP_SELF
?start=
$pos
&limit=
$limit
\"
>"
;
print
"Next -></a>"
;
print
"</font>"
;
}
else
{
print
" "
;
}
print
"</td>
\n
"
;
print
" </tr>
\n
"
;
print
"</table>
\n
"
;
}
end_html
();
?>