473,508 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to design the newsline

Hi all you fine people!

I'm rather fresh in php and I'm designing webpages for a local sportsclub.
I have to design a way to print latest information on the frontpage, like
about 'Note that Tonight's Rambo Excercise for Kids takes place at the
sportsfield if the weather allows - Susanna"
My idea is that several people would update these lines, and that there
would be e. g. five latest messges visible.
Limiting the size of a message might be a good idea. Pages are in finnish,
and we need to use some extended characters, like ä etc.
I was thinmking that there would be a form, where certain people could
leave a message. The message would be added at the end of the file
'news.txt', the date and time of the message would be saved in the same
file as well. Then there would be a script thet reads the text until the
sixth date would be encountered, and prints each message on the frontpage.
I thought I would even use <pre class="message"></pre> markup if necessary.

Does anyone have any suggestions on how to do it? Is it wise to use one
file and append all messages to it? I have heard the fopen() and other
filefunctions are generally rather slow, although the traffic won't be very
busy on this site.
Does anyone have a better way to choose for me? I have no need to set up
any database solution for this.
Oll¡maX!

--
email : ollimantyranta"boing"sunpoint"boing"net
Jul 17 '05 #1
3 1674
On 2004-01-20, OllimaX <ol************@example.com> wrote:
Hi all you fine people!

I have to design a way to print latest information on the frontpage, like
about 'Note that Tonight's Rambo Excercise for Kids takes place at the
sportsfield if the weather allows - Susanna" My idea is that several people would update these lines, and that there
would be e. g. five latest messges visible. leave a message. The message would be added at the end of the file
'news.txt', the date and time of the message would be saved in the same
file as well. Then there would be a script thet reads the text until the
sixth date would be encountered, and prints each message on the frontpage.
I thought I would even use <pre class="message"></pre> markup if necessary.


This is the way i would do it: (Avoiding searching latest 5 message in a
file etc)

Assuming you have already x posts in a file:
allposts.txt

Store the last 5 most recent posts in a file:
x+4.txt x+3.txt x+2.txt x+1.txt x.txt
(Say you already 10 posts, the files would be 14.txt, 13.txt, ...
10.txt)

Now each time a post is added, append it to allposts.txt and put it in a
file called x+6.txt. Remove the file x.txt

Next time a post is added, append it to allposts.txt and put it in a
file called x+7.txt. Remove the file x+1.txt
(In general: remove the x-5th file)
To show the most recent posts, instead of searching in allposts.txt just
display the 5 txt files ;)

--
http://home.mysth.be/~timvw
Jul 17 '05 #2
Tim Van Wassenhove <eu**@pi.be> kirjoitti 20 Jan 2004 14:06:25 GMT:
To show the most recent posts, instead of searching in allposts.txt just
display the 5 txt files ;)

Thanks, I got what you mean.
--
email : ollimantyranta"boing"sunpoint"boing"net
Jul 17 '05 #3
On 2004-01-20, OllimaX <ol************@example.com> wrote:
Tim Van Wassenhove <eu**@pi.be> kirjoitti 20 Jan 2004 14:06:25 GMT:
To show the most recent posts, instead of searching in allposts.txt just
display the 5 txt files ;)

Thanks, I got what you mean.

When i come to think about it, don't make an allposts.txt file.

Just put each post in a file. This is much easier to update existing
posts etc too.

--
http://home.mysth.be/~timvw
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4112
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
1888
by: Edward Diener | last post by:
In Borland's VCL it was possible to divide a component into design time and run time DLLs. The design time DLL would only be necessary when the programmer was setting a component's properties or...
7
2972
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
2358
by: Paul Cheetham | last post by:
Hi, I have moved an application from VS2003 to VS2005, and I am now unable to view most of my forms in the designer. The majority of the forms in my project are derived from class PACForm,...
1
6320
by: Nogusta123 | last post by:
Hi, I have had a lot of problems getting web pages, master pages and content pages to render in VS2005 design view the same as they would in Internet Explorer. I did a lot of looking on the...
0
2492
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
19
3134
by: neelsmail | last post by:
Hi, I have been working on C++ for some time now, and I think I have a flair for design (which just might be only my imagination over- stretched.. :) ). So, I tried to find a design...
10
3619
by: vital | last post by:
Hi, I am designing the middle tier of a project. It has 6 classes and microsoft application data access block. The six classes are DBServices, Logger, ProjectServices ... etc. and all these...
4
2446
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.