Posted by Michael Austin on 02/18/06 03:03
Dalibor wrote:
> I wrote some code for displaying news on my website.
> Code goes like this:
> <?
> $newsfile = 'news.txt';
> echo "<B>TRENUTNE VIJESTI</B><br>\n";
> $data = file($newsfile);
> $data = array_reverse($data);
> echo "<span style=\"normal 11 Verdana; color:#fff; text-align:justify;\">";
> foreach($data as $element) {
> $element = trim($element);
> $pieces = explode("|", $element);
> echo $pieces[2] . "<BR>" . "<span style=\"font:normal 11px
> Tahoma\"><u>Published</u>: " . $pieces[1] . " " . $pieces[0] .
> "</span></span><BR><br>";
> }
> ?>
> I have form that puts content in flat file.
>
> Messages are writen in flat file in format like this:
> 21.Feb 2006.|Dalibor|Some message text
> 14.Feb 2006.|Dalibor|Other message text...
>
> I need piece of code for displaying last 5 messages and for deleting
> certain messages.
> Can you help me? Thanks!
writing your own newsreader?
have you looked at http://www.newsportal.one.pl
It even runs on my OpenVMS/Alpha system.
--
Michael Austin.
DBA Consultant
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Navigation:
[Reply to this message]
|