The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
So, unless I edit the news data to turn the tables around everytime I enter some news it will stay the same.
Is there a script I can enter to flip the tables around or so that next time I enter some news in it enters it into the top instead of the bottom? thanks.
news script: http://membres.lycos.fr/enterthefog/update/news.php
Change to the "a" to "r+", see about that.
--------------------------
print "
Submit News
";if ( isset($actionflag) && $actionflag == "join")
{
if ( ! file_exists("news.txt") )
{
touch("news.txt");
}
$fopen_contents = fopen ("news.txt", "r");
$fread_contents = fread ($fopen_contents, filesize ("news.txt"));
fclose ($fopen_contents);
$fp = fopen( "news.txt", 'w' );
fwrite ( $fp, "
| "); fwrite ( $fp, "$form[subject] " ); fwrite ( $fp, "Posted by $form[author] " ); fwrite ( $fp, "$form[text]" ); fwrite ( $fp, " |
fwrite ( $fp, $fread_contents);
print "News Sent!";
}
if ( isset($clearflag) && $clearflag == "clear")
{
unlink("News.txt");
touch("News.txt");
print "Database reset!";
}
?>
ok, ok i'll post the script:
print "
Submit News
";if ( isset($actionflag) && $actionflag == "join")
{
if ( ! file_exists("news.txt") )
touch("news.txt");
$fp = fopen( "news.txt", 'a' );
fwrite ( $fp, "
| "); fwrite ( $fp, "$form[subject] " ); fwrite ( $fp, "Posted by $form[author] " ); fwrite ( $fp, "$form[text]" ); fwrite ( $fp, " |
print "News Sent!";
}
if ( isset($clearflag) && $clearflag == "clear")
{
unlink("pages/news.txt");
touch("pages/news.txt");
print "Database reset!";
}
?>
ORDER by DESC
(or ASC, I can't be bothered to work it out)
This is assuming you know something about MySQL :) If not, just paste the query here and I'll modify it for you.
the file is called npost.php it's one of two files :)
Title Date
text..........
and for what you see on the news page where it's all updated to.
thats the whole thing, including the updating page.
atm it write all the news to a text file, it's all stored in there.