This is a discussion on "blog structure" within the PHP Forum section. This forum, and the thread "blog structure are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
blog structure
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
I'm looking to making my own blog
i don't want to use someone elses code because i want to learn how to do it myself and updates and new features would be very confusing. so this is my quesyion. basically, how are the structured in general. like are entries in an external file and are included using an ssi. or are they stored in a database. also how do i do permalinks. and how do you access a certain entry, like: blog.com/blog.php?article=1 or blog.com/blog/articles/1 Thanks
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|
|
||||
|
Re: blog structure
okay so say i have a database called blog
with two tables called categories and comments. but what columns would they have?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: blog structure
You have a database called blog with 3 tables called blogs, categories and comments
Let's start with the blog table ... what do you think you should have in there? |
|
||||
|
Re: blog structure
posts: title, timestamp, id, entry, category etc.
categories: category id, category name, description comments: user id, comment, timestamp user: user id, name, email, url etc. Its called database design, you need to think of every piece of information tyour going to need and organise it within the database so it can all link together without causing duplicates. try a search on database normalisatiopn...see what you get. In the small brainstorma above when a user signs up thier details go into user table, when they comment their comment goes into the cooments table with their user id. When we wanna display the comment we grab the user id, and use the user id to query to usert table to get the users info and sisplay it aloing with the comment. This prevents duplicate data. if you didn't split it into user and coomments your comments table would probably be something like: username, url, emal, comment, timestamp...etc. And if the same user commented 20 times their detyails would be duplicated each time. By spliting it there is no duplication. |
|
||||
|
Re: blog structure
Quote:
|
|
|||
|
Re: blog structure
Remember too this is about content management. If one day you decide you want add images or maybe a recipe to a post don't just put an image in that post or type that recipe up into the blog post window. The reason for this is that say a few months down the line you want to be able to search through all of your recipes or all of you photos then you will struggle whereas if it is a totally separate section then the possibilities are much better. All you o then is relate that image or to a particular blog entry.
This all may sound a bit much at first but you need to understand the idea behind content management. If you do it right it will be completely scalable and expandable which is what you want really. Pete. |
|
||||
|
Re: blog structure
Quote:
theres still a lot of work to do. I'm not gonna tell people how. I had to learn it so everyone else can as well. Sorry I'm in a bad mood lol. |
|
||||
|
Quote:
though for editingm, I guess I'd need to make some system where i can edit the post in textarea form or something I'm guessing?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: blog structure
Quote:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: blog structure
Well you could just add another column but ideally that should be in its own table with all its own data such as when it was taken, when it was uploaded, what its of, etc. This way if you wanted a really snazzy image gallery in the future it would be very simple as the data is isolated. By just adding a column you reduce your options for the future and you reduce the usefulness of that image.
Pete. |
|
||||
|
Re: blog structure
okay
well if i don't go out on the town tonight. I'll start
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: blog structure
hey what should my entries column format thing be?
I'm on about the thing which says how many letters can be in each row etc. thanks
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: blog structure
Probably longtext but I'm no expert, really.
Pete. |
|
||||
|
Re: blog structure
Yeah I think so
Oh and could someone tell me what BLOB is?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: blog structure
And what should the date column be?
I want to insert into it using the CURDATE command. thanks
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: blog structure
Well it's a number so int which I assume means integer (whole number).
Pete. |
|
||||
|
Re: blog structure
i can't get this to work :s
eh ?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: blog structure
This is how I would create my DB for a blog, this is pretty simple but the principles are there:
Pete. |
|
||||
|
Re: blog structure
Thanks pete I'll try that now
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Tags |
| blog |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Frame structure | WLQ | JavaScript Forum | 1 | Oct 8th, 2007 09:56 |
| Help with website structure | irinag | Starting Out | 3 | Apr 24th, 2007 18:43 |
| table-like structure | dscanlon | Web Page Design | 4 | Jun 27th, 2006 15:10 |