Blog: Options?

  • Moses08
  • Graduate
  • Graduate
  • Moses08
  • Posts: 196

Post 3+ Months Ago

Hi,

I've basically created the layout for my blog website, but I still need to write the script for the blog. I am thinking of using a MySQL database to store my entries and to use PHP to draw the entries out and display them in the correct places. Keep in mind I want it to automatically archive all of my posts by date that you can look over at a later time. Is this a good idea? Would there be a better/easier way of doing this?

Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Liquescence
  • Proficient
  • Proficient
  • User avatar
  • Posts: 353
  • Loc: Queens, NY

Post 3+ Months Ago

An easier way would be to use something like Greymatter or Movable Type. These use cgi though, not php and sql.
  • Sabu
  • Beginner
  • Beginner
  • Sabu
  • Posts: 47

Post 3+ Months Ago

Well.. I should here make note of the fact that I have made a blog website myself, which is going fairly well. I do not at this time wish to display a link.

However, I can tell you that it was done with mysql holding all the post information, and php calling them. As for 'archiving', I'm not entirely sure what you mean, but no 'compression' tactics are used - it just keeps each post in its own entry, and the pages show the appropriate ones.
  • Moses08
  • Graduate
  • Graduate
  • Moses08
  • Posts: 196

Post 3+ Months Ago

Sabu wrote:
Well.. I should here make note of the fact that I have made a blog website myself, which is going fairly well. I do not at this time wish to display a link.

However, I can tell you that it was done with mysql holding all the post information, and php calling them. As for 'archiving', I'm not entirely sure what you mean, but no 'compression' tactics are used - it just keeps each post in its own entry, and the pages show the appropriate ones.


By archiving, I mean I want my home page to have like 3 entries and then a seperate page to hold a list of dates that you can click on that will bring up the entry for that day.
  • Sabu
  • Beginner
  • Beginner
  • Sabu
  • Posts: 47

Post 3+ Months Ago

oh, easy easy

Another page, going through the posts and grouping them by date. While we're brainstorming, I think I'll go and put that one together
  • Moses08
  • Graduate
  • Graduate
  • Moses08
  • Posts: 196

Post 3+ Months Ago

Now all I need to do is script it!

I have no experience with MySQL or PHP, but I am trying to learn. I am understanding PHP much more than MySQL. Anybody want to give me a hand scripting this?

My table will have 4 columns: id, date, title, entry

id: Auto-incrementing. Used to organize entries.
date: Date and time of posting.
title: Title of the post.
entry: Text of the post.

Basically I want to enter the title and entry in an external file (something like "2004-01-01.htm" and have the database draw it out and display it on my website. Any ideas on how I can accomplish this?

You can take a look at my website so far if it will help: http://pbworld.u69.us/index.php
  • Rat
  • Guru
  • Guru
  • User avatar
  • Posts: 1190
  • Loc: desk

Post 3+ Months Ago

why not just down a php blog script?
  • Moses08
  • Graduate
  • Graduate
  • Moses08
  • Posts: 196

Post 3+ Months Ago

I would rather have my own. It means I don't have to modify somebody else's work and I don't have to display their advertisment. Also, this would be a good learning experience for me as a web developer.
  • Sabu
  • Beginner
  • Beginner
  • Sabu
  • Posts: 47

Post 3+ Months Ago

Yreah, I resolutely stayed away from the temptation to download the livejournal source or something equally uncreative, but I ventured forth and made my own.

By the way, my 'posts' table:

id
userid
date
text
smilies: users can specify whether they want smilies to show on their post or not

other features: polls that attach themselves to posts, custom timezones that users can set themselves to so therefore see all posts as relative to their time, cutom time formats (I don't know, someone wanted 24-hour time), interests, comments, avatars (that users can upload), friends, a proximity locator, style templates, custom styles.. woah, it's bigger than I thought
  • Moses08
  • Graduate
  • Graduate
  • Moses08
  • Posts: 196

Post 3+ Months Ago

Still looking for some insight on how I should accomplish this. I don't really know where to start.
  • Sabu
  • Beginner
  • Beginner
  • Sabu
  • Posts: 47

Post 3+ Months Ago

Learn PHP through months of research, analysis and coding from examples.

Learn MYSQL through months of research, analysis and coding from examples.

Make the site on your computer while it's in developement, until you get it to a publishable point

Upload to a web server, preferably a good one, free if you have to.

Gradually expand your empire and hope enough people donate to cover your increasing bandwidth usage.
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

What you're asking for is more complicated that most of us could really explain in a post or two.

Get phpMyAdmin to run your mySQL database. Serously... It will help. A Lot.


(This might go over your head right now, but it will make more sense as you research mySQL more)

Also, per entry record, add a deleted (or archived, call it what you want) field that's a type TINYINT(1). Then, to archive it (assume eid is the name of your primary key field... you DO have one of those, right?) just use: "UPDATE yourtable SET deleted=1 WHERE eid=23;"

Then, always make sure that your non-archived view has a where clause of deleted=0.

Also, it would be helpful to have a DATETIME field for created (and when you run any INSERT make sure to add now() as it's value) and a TIMESTAMP field for lastupdated. Then, you can track last edits, and first create dates easily. TIMESTAMPS are automatically updated my the server when a record is changed, so you can leave it out of your UPDATE calls.

mySQL is really pretty simple. Actually, DBA in general, is pretty simple at its root. Databases are little more than a very complicated spreadsheets. SQL, in it's simpler forms anyway, it extremely easy to understand. Learing SELECT, INSERT and UPDATE calls will let you do 90% of everything you will ever need to do with any relational database...

I'm oversimplifying some thing on purpose here, but the fact is, it takes some determination, but it's not hard to figure out with time.

.c
  • madmonk
  • Mastermind
  • Mastermind
  • madmonk
  • Posts: 2115
  • Loc: australia

Post 3+ Months Ago

i would say ,get a php script.
coz in the first place, you don't know much about php

Get a script and you can learn frmo the script as well.

you can pick up php slowly as you go along as well.. :D

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 146 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.