Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

design-is

macrumors 65816
Original poster
Oct 17, 2007
1,219
1
London / U.K.
Hi all...

I wondered if anyone knows of a way to set up a blog within my site which doesn't need MySQL.

All options I can find require it, and my present hosting package doesn't support it, but it does support php 4 & 5. I know I can sign up to an external blogging option and just link out, but if possible would like to integrate it directly within my site.

Thanks for reading, and in advance for any useful comments :)
 
Well I'm currently working on a XML-based blogging system for my site that doesn't need a database. All the blog entries are stored in XML format and then I use PHP and XSL to retrieve the information and display it. I don't get a lot of time to work on it and won't be adding admin type controls, but would still be possible.

I've also read about projects that setup XMLDB. You may be able to make use of one of those. There's likely other people working on this so if you do some searching you might turn up something. If you find something you like be sure to post back. I wouldn't mind hearing from people implementing such a system.
 
A simple method may be to use the filesystem to store blog posts... but a database is much nicer, in my opinion.

If you were to write something which used the filesystem, it could use a folder in which files for each entry would be placed, and then use the file creation time to sort through... but performance might be a bit spotty. Alternatively, it could use a file xref-ing the files for each of the blog posts in the order which they should appear in the blog.

To improve writing performance, the file could be appended to (rather than prepended to) but then you'd have to read the file backwards. If you make each file xref record have the same length, then you could actually seek to the end of the file minus 25 * (the length of a record) to get the last 25 blog posts, then reverse the order.

For tagging, a similar method could be used: an xref file for each tag.

The blog could, however, be rather inflexible, as it would be difficult to remove blog entires (unless you just blank out the lines) and extremely difficult to insert and reorder. A possible solution would be to use linked lists of entries rather than single entries - in such a solution, the xref file would start with an identifier (perhaps a byte offset) of the last entry, which would point to the second to last, and so on and so forth. However, performance would then degrade as more and more posts are processed; if you have 1000 posts and someone looks at post 1000, the server will have to process through 999 first.

However, with a linked list, it would be trivial to create a page index which increments every time a post is added -- it would have records linking, for example, page 1 with the most recent post, page 2 with the 25th most recent post, and so on.

To allow URLs like myblog.com/2008/02/23/mypost, you could put the entry files into that same structure: a folder for 2008, a sub-folder for 02, and a sub-sub-folder for 23. The xref files for both tags and the entire blog would include the path (ie: 2008/02/23/blogpost.xml)


As for XML: large XML files can be unwieldy, which is why I recommend having many, separate files instead (whether you use XML or not).
 
Hi all...

I wondered if anyone knows of a way to set up a blog within my site which doesn't need MySQL.

All options I can find require it, and my present hosting package doesn't support it, but it does support php 4 & 5. I know I can sign up to an external blogging option and just link out, but if possible would like to integrate it directly within my site.

Thanks for reading, and in advance for any useful comments :)

blogger allows you to customize your blog html completely to fit your look and feel. They also allow you to publish onto your site so it is transparent.
 
Thanks for all your input guys!

I will continue to research this until I find something more solid.

Feel free to continue discussion as I'm sure it will help. Or post solutions if you come across any :)

blogger allows you to customize your blog html completely to fit your look and feel. They also allow you to publish onto your site so it is transparent.

I will have to look into this, thanks for the info!
 
Sorry to point to the negative here, but I'd be a little leery of a host that supports php 4/5, but not MySQL. The two really go hand in hand.
If you're not willing to move hosts, then the blogger solution mentioned by someone else is probably your best bet.

Hi all...

I wondered if anyone knows of a way to set up a blog within my site which doesn't need MySQL.

All options I can find require it, and my present hosting package doesn't support it, but it does support php 4 & 5. I know I can sign up to an external blogging option and just link out, but if possible would like to integrate it directly within my site.

Thanks for reading, and in advance for any useful comments :)
 
Sorry to point to the negative here, but I'd be a little leery of a host that supports php 4/5, but not MySQL. The two really go hand in hand. <snip>

Its a good host... well, its served me well anyway.

http://streamline.net/wh.php

I just went for the home user when I registered because at the time thats all I was... Now I need a little more but am reluctant to pay more if I don't need to - obviously :)
 
Sorry to point to the negative here, but I'd be a little leery of a host that supports php 4/5, but not MySQL. The two really go hand in hand.

Exactly. That's pretty much a standard these days. If you're not getting MySQL included, even with the cheapest package, then you're not getting your money's worth. Compare your current hosting with GoDaddy's $3.99/month (or $45/year, not much more than you're paying now) basic hosting that includes MySQL. Sorry, I know this is a bit off topic, but I hate hosting companies that try to cheat their customers. I say force them to be competitive or move on to someone better.
 
Grab "SQL Lite" and use that. It's free. SQl lite is a DBMS that does not use the client/server model. It is just a library that you link into your own code. It works as a layer above the file system.
 
Grab "SQL Lite" and use that. It's free. SQl lite is a DBMS that does not use the client/server model. It is just a library that you link into your own code. It works as a layer above the file system.

Interesting... I'll look into this tonight. Thanks very much!
 
Thanks again for all your help guys and girls :)

It is much appreciated!

-UPDATE- Just to update, cute news is working great for me :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.