Welcome to WebmasterWorld Guest from 54.166.222.116

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php blog(ish)

creating a blog for a client need some info

     
1:54 pm on Jun 18, 2009 (gmt 0)

5+ Year Member



Hi everyone.
I am creating a type of blog for a client that he can write to.
I have made the script that stores the new data and displays it from MySQl database.
But the thing i really need help n is the auto-archive feature.
The reason for this is because i want the newest blogs on the first page and the old ones get archived and brings up a link to the old blog at the top of the page.

I think this is possible but after thinking about it i have not a clue how this could be innitiated, any help would be greatly appreciated (I know everyone on here is so helpful)

If you dont understand please let me know and i'll try and simplify it.

Many Thanks

3:03 pm on Jun 18, 2009 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



to get the newest content on the main page you just select by date desc, if you set a limit then the older ones will just drop off as more are posted

for the link just select the story with the max id, I assume there is an id of some kind. You could also select by date descending and limit to 1 result

3:48 pm on Jun 18, 2009 (gmt 0)

5+ Year Member



So for the archive links at the top, how would they automatically happen? and could i put a date in big bold header of when the blog was produced?
4:09 pm on Jun 18, 2009 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



most blogs group by date or category so you could do your archives using 1 of those options I would think.
8:06 am on Jun 19, 2009 (gmt 0)

5+ Year Member



how would i go about this?
1:33 pm on Jun 19, 2009 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



just as an aside, why are you recoding the wheel on this? Especially if it is for a client, There is a ton of blog software out there. Just wondering ;)

I would suggest getting some of that software and studying how it does the things you want to do, you can then reproduce it more easily.

each post would need to be in a category
you could then write a select query that does what I laid out

to list the number in a cat
select count(post_id) as totalposts from posts where cat_id=3

then a page of listings, newest to oldest
select * from posts where cat_id=3 order by postdate desc limit 10

or something of that nature

2:43 pm on Jun 19, 2009 (gmt 0)

5+ Year Member



Before you try and order by date, are you actually storing the date in a field with the post?

If not look at the mysql date and time functions, especially NOW() to store the current time with the post.

11:42 am on Jun 22, 2009 (gmt 0)

5+ Year Member



i have decided to use and adapt b2 evolution blog which is great because i can learn while im doing it.

It's a pain not knowing probaly the most simplest things.
I've been doing this now for 9 months and all self taught, so thank you all for your help

 

Featured Threads

Hot Threads This Week

Hot Threads This Month