PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
G-Rard_B
Worker
Worker


Joined: Sep 01, 2004
Posts: 105

PostPosted: Tue Sep 07, 2004 7:03 am Reply with quote Back to top

Hey! I am working on a website (InstantPolitics.us). My dad and I are going to be administrators. We have a phpBB forum and an upcoming chat (FlashChat). I wanted to make it easy for my dad and I to post announcements on the home page (like in PHP-Nuke). I didn't want to use MySQL for that so I'm storing everything in a .txt file. The script works perfectly. I just have 2 questions.

How do you make it so that the new announcements are placed on top of the old ones? I'm assuming I'll have to work with Arrays, but I'm not sure

Also, how do you make it so that only the latest announcements (5 for example) are placed on the home page?

Thaks,
Gerard
View user's profile Send private message
G-Rard_B
Worker
Worker


Joined: Sep 01, 2004
Posts: 105

PostPosted: Wed Sep 08, 2004 10:05 pm Reply with quote Back to top

Nobody? I think I have to put each line as an array, and then use the arsort() function and cut out some of the file so that only 5 lines show. I've been trying and this is what I've come up with. It only shows "1" where I want it to show the announcements....

Code:
$thefile = "announce.txt";
$open = fopen($thefile, "r");
if($open){
$data = file($thefile);
$getline = explode("</center>", $data);
$announce = arsort($getline);
print "$announce";
}
fclose($open);

If you must know, each line nds with "</center>" which is why I used it in the explode() function.

Thanks,
Gerard
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum