Forum Moderators: coopster

Message Too Old, No Replies

Site Organization

PHP, MySQL DB help...

         

madcat

8:57 pm on May 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having trouble visualizing the approach I should take to writing this site. It needs to be dynamic. It's a news site so the stories will be changing constantly. I want to build this right from the ground up so that it is modularized and scalable.

I figure I would create two templates. One for the main page and one for the subsequent story pages. Use PHP includes for the common elements and a $content variable for the actual information. Would this be a good move? If so,

How should I start thinking about feeding the information into these templates. The front page will have constant navigational elements that link to the stories of the day or week. For example, if story #1 in the first spot is about speakers, where is the best place to pull this story from? A DB? The story about speakers might only be there for a week, it needs to be replaced by the next story about microphones...is there a way to automate this process efficiently. Or should I just create regular .html files and link to them as I normally would?

I'll have few more questions, but I'll start with these and see if they make sense;) I appreciate any help on this!

M

Nick_W

9:01 pm on May 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I figure I would create two templates. One for the main page and one for the subsequent story pages. Use PHP includes for the common elements and a $content variable for the actual information. Would this be a good move?

http://smarty.php.net

As for the rest, yeah: DB.

Nick

madcat

10:45 pm on May 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nick- Is Smarty something that I can be up and running with in a couple of days? I'm reading the docs as I write this.

So far it sounds like it limits your design possibilities. Is that true?

lorax

11:08 pm on May 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you need to get it up and running that quickly you might want to check into PostNuke. Otherwise build it yourself and don't worry about the time.

As for static versus dynamic for the news stories. I'd go with dynamic (db) for the current news and then archive the stories as html files after a certain date. You could automate the archiving process within an Admin area ("click here to archive stories" or some such to trigger the process).

I'd think that in order to ensure the spiders get enough food you'd want to be sure there's a good proportion of static content on that top page as well.

willybfriendly

11:29 pm on May 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP and MySQL Web Development, by Luje Welling and Laura Thomson.

Chapter 26 uses a news site as an example of building a content management system. Geadlines, graphics, articles, user interface are all there.

Learn as you build your own custom system.

WBF

madcat

11:44 pm on May 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



willybfriendly - Just so happens I was thumbing through my cabinet for that book this very moment- thanks.

A couple thick questions...When using PostNuke or Smarty, do you build your website the way you want it and then integrate it with the (program?) To me the websites failed at showing good introductions on how to get started from scratch. Perhaps I didn't find the right docs but I'm coming from out of the blue here.

What are some other advantages to using a CMS that you can't provide when coding the whole thing by hand?

>> I'm asking because I need to know if I should go ahead and create the CSS/Table layout and all the elements, then worry about the aspect of feeding in the information from the DB.

Thanks again...

div01

1:45 am on May 5, 2003 (gmt 0)

10+ Year Member



Re off the shelf CMS packages.

Have you looked at Typo3? It was too much of an overkill for me, but could be helpful for you.

Nick_W

9:37 am on May 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>smarty - couple of days

Yeah, piece of cake.

Here's the code for a page at it's absolute simplest level:


$s=new smarty;
$s->assign('title',$title);
$s->assign('content',$content);
$s->display('myTemplate.ihtml');

That would be a crime though. It has a LOT to offer.

Nick

lorax

1:33 pm on May 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



PostNuke is a website in a package deal. In order to customize it you'll need to figure out how they built it and then make your mods. There is an active support forum and community and many modifications are freely available. This is not an SEO friendly solution and customization is not for the novice PHP programmer. It's just something that you can use to get a quick and dirty solution up while you work on a more appropriate solution.

madcat

5:49 pm on May 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One last question about this-

If you built a dynamically driven website from scratch (w/o Smarty), and created templates that pulled information from a database - made everything modular - scalable...how is using Smarty any different? Does it just simplify the process?