Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
php blog(ish) creating a blog for a client need some info togethercomms
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.
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
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? jatar_k
most blogs group by date or category so you could do your archives using 1 of those options I would think. togethercomms
how would i go about this? jatar_k
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
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.
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