Jump to content

Creating news


securobo2

Recommended Posts

Hi, everyone. I hope no one will get upset at me for posting a similar topic, but based on the number of views and no responses for my last post, I figured the following is true. It is difficult to follow someone's request for help, when there is alot that has to be looked at external to the forums. So instead, in this thread, I would like to change the question I asked to something more simple and I would like to make sure I post code here in the forum.Let me start at the beginning. Here is my skeleton HTML page, which is a page that displays the news. Even though this looks like a rough example, please keep in mind that it is the actual code minus the css styles. The point is, that at this time all I can do is add a div every time I want to add a news article.I would like to know if someone can help me on making this more dynamic. Adding and removing an article this way is ok, but there is a function I would like to have. After 10 articles, let's say 12 for this example, I would like to generate 2 pages. Page 1 would have the 10 latest articles and the next page would have the remaining 2 articles, which makes 12. If I do this manually, then when I have alot of articles, it's ridiculously cumbersome to keep shifting the first and last page.What can I do? I thought that keeping all the articles together in a text file would allow me to use some script for example to divide the pages dynamically. I understand the concept, but I am not sure how I could do this. What scripting language could I use to load a page. I would like to limit myself to Javascript, PHP and xHTML. I am still a beginner, so I am looking for very simple easy to follow examples. As simple as this skeleton code.Can someone post an alteration to this code on how they would solve this problem? You do not have to clean it up with css, unless it's absolutely necessary for the page to function.

<html>	<head>		<title>news page</title>	</head>	<body>		<div>			<h3>Sometitle was just released</h3>			<p>				Sometitle is an excellent game. It has everything you would ever				want in a Somecompany release.			</p>			<p>				Rating ****. (4 out of 5 stars)			</p>		</div>		<div>			<h3>Othertitle the worst game in history</h3>			<p>				Othertitle wins the worst game in history award. The point and click				control is so bad I replaced my mouse with voice recognition.				Somecompany needs to start over if they want to stay in the game.			</p>			<p>				Rating *.... (1 out of 5 stars)			</p>		</div>	</body></html>

Link to comment
Share on other sites

If I understand you correctly, you want to make an archive system, where your older news articles get archived to a different page. The latest news (front page) is limited to 10 articles. I'm relatively new to web design myself, but from what I understand, you can probably accomplish this using Wordpress, or some other free content management system. Writing HTML and CSS is not going to automate a process. Your HTML looks to be as simplified as you can hope for.Edit: I read your other post (below). If I were you, I'd go with Wordpress or some such. If you want to access plain .txt files, I think that would involve javascript ... you'd be better off making them .html files. The simple page links at the bottom would be a simple horizontal menu, no need for anything fancy. You could accomplish all of this using simple HTML and CSS, but as you've discovered, it's more of a manual process, not automated.

Alright, I am putting up a website. It is very simple in design. Just used XHTML up to this point. I would like to maintain this manually, so nothing fancy is necessary. However, I need help turning the design into something that can be redundant.Here is a link to my work in progressindie-hq.netEverything could be seen by viewing the source in your browser. The css file of course could be retrieved that way also.What I would like to do is maintain Reviews and News in their own documents. For example I would have a news.txt and reviews.txt document. Then when someone visits the site and clicks on Reviews for the reviews or Home for the news, I would like to list 10 items (reviews or news). If I add more items to the *.txt files, they should divide up automatically into pages of 10 items each. They would show up in the content area div. I would like them to be served with a small link list at the bottom like thisPrev 5 6 7 8 9 NextThe traditional page links setup. In this way I have 2 questions. How could I accomplish this the easiest way and 2, can someone give me an example. Once you see my layout design in source view, you will immediately see that it is extremely basic. This is both because I am new to this and also, because I try to keep it to a minimum. In the least amount of code, what can I do. If you have other suggestions than using *.txt files, please let me know.One more thing. I would like to include <img> tags in the text file, so I can add images to the reviews. I don't want to use frames whatsoever, and certainly not just load text. The text might be formatted with different colors and etc.If possible, please only XHTML, but if you suggest PHP, please - the bare absolute minimum in functionality, just enough to load the reviews and add images. If I use a scripting language in the future, it will be PHP.
Link to comment
Share on other sites

I agree with Abby. Unless you are looking for a PHP project, just use an existing content management system like Wordpress. There is plenty there for beginner to pick up valuable PHP, HTML, CSS, MySQL, and JavaScript skills with tested and stable code. If you are trying to develop some heavier skills, use with a PHP framework like Cake or Zend. No need to re-invent a bunch of wheels.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...