{Carrer web log}

Blog about web design & development

Quark – mini php CMS

Monday, March 01, 2010 { 12 Comments }

Quark is probably the smallest Content Management System build with PHP. It’s actually build of one PHP function.

It’s meant to help web designers to manage small web sites.

Why I build it?

I work mostly for one firm where we hand code everything. When we build web site we start from scratch. So we build the web site and the management behind the site for our clients, often the management behind the site is more complex then the web site itself. For every site the programming and web logic is different. That is why we need a lot of time to build everything, result we are expensive.

In order to be more competitive for the clients with the less budget we tried to use Joomla. We get very enthusiastic at the beginning specially the part where we don’t have to develop the admin part. But after two years we realize that the time for developing is almost equal but we charge less. Other problems we pray that hackers don’t attack us, that component developers give continuous support and the critical point how you debug 3000 – 5000 file monster. I repeat 3000 php files for one web site … WTF!? Don’t get me started about the quality of HTML , CSS and quality of major of Joomla templates.

So I tried to try to resolve the problem, first I tried to build system that will be able to automatically manage any MySQL database by creating MySql Lite Administrator. Only thing is you need primary key in the tables . Everything else is automatic.

Then I wanted to build CMS for the front, but I didn’t had time and I right “philosophic” ideas how complex should be the system . Then I sow CushyCMS and liked the simplicity but didn’t like that you should change the CSS logic in order to work. Then I saw the video on Drew McLellan's - Perch and I sad this is it! This is the principle that I was looking. So I decided to start from Perch idea and build something damn simple.

So I did it, one PHP function and one MySQL table. And this is it. I name it Quark after the Quark particle . A quark is an elementary particle and a fundamental constituent of matter.

The principle is simple you replace text or html with . So you can put plain text or html for links, images, link list and many more.

If you have very simple site and you want to edit few things like menu, some text this is right solution . I think with little creativity you can make a lot of stuff. The main point to this project is to add dynamic parts to your static small site. So you can build static HTML + CSS site and then make editable some parts like menu, text, links, images est.

Quark does not mange forms so you can’t use it like blog platform. Quark is not meant to replace big CMS like Joomla and Drupal.

And for the management of the DB you can use MySql Lite Administrator or build your own managing system.

If you need to manage forms, resize images ,multilingual support you can purchase Perch or some other small CMS.

Some technical details: Like I said before Quark is made of one php function and MySQL table. You can use PHP4 or PHP5. The php function is extremely simple to understand so everyone with little knowledge of PHP can understand it. My goal was to make very fast MySQL interrogation I was experimenting mainly with mysql_fetch_array and mysql_fetch_row and the results are there are no notable differences.

I tried to run 25 calls(20kb each) to database with total amount of 55.000 words or 85 word document pages with Lorem ipsum text time of execution 0.1 seconds and 0.09 MB Ram. My point is this thing is quick even if you have large amount of data.

How to use it?

There are three columns inside the DB table called quark_table one columns is content and another called name_tag.

Put any content inside lorem ipsum, HTML ..ipsum
2Any HTML or textany_name_you_like

So inside HTML you can call the or .

Important to remember that you can choose any name you like so you have absolute freedom of naming your tags. The names should be unique.

And that is it.

When to use it?

Imagine that you have 10 page pure HTML + CSS site the client ask you to add one extra page on the site and to put one link that that will lead to the new page. If you have the same link structure in all 10 pages you will probably go page to page and change manually all the pages.

Or with Quark you will make something like and change it just once.

Same goes for all the repeating multiple parts of your static HTML like header, footer obviously depending on your site architecture.


Download Quark +DB Structure + Demo

For managing MySQL table you can use MySql Lite Administrator

Disclaimer: I wasn’t sure how to call this project Is it CMS, Is it PHP Template engine or just one simple nifty php function. In some way this project Manages the Content so Content Management System it is.

12 Responses to “Quark – mini php CMS”

  1. // Anonymous Andy // 3/01/2010

    3000 php files for one web site … WTF!?

    I noticed that with Joomla a while back - it's just madness.

    A CMS built with only one function? Surely the world's smallest CMS :)  

  2. // Anonymous Elena // 3/01/2010

    It's really interesting article. Thanks for good information.  

  3. // Anonymous Anonymous // 3/02/2010

    it is not a CMS, it is a simple CURD Demotration.  

  4. // Blogger and so it goes // 3/03/2010

    Could you post a screenshot?


  5. // Blogger Vladimir // 3/03/2010

    @Andy & @ELena: Thanks :)

    @Anonymous:CRUD is (create, read, update,delete) but is so small that is just only R from CRUD or Read.
    With the help of MySQL Lite Administrator is just CRU from CRUD.
    The point of this project is to show what all you can only with one PHP function.

    @and so it goes: Here is the screenshot: http://picasaweb.google.com/lh/photo/mdxF6TMA2XBPbWQx4UMi6w?feat=directlink  

  6. // Anonymous Joseph McCullough // 3/10/2010

    Really cool and efficient idea. I've been meaning to take the time to learn how to create a very basic CMS like. Hopefully I can expand off this great example.  

  7. // Anonymous Nill // 3/31/2010

    Very, very interesting. Thanks for the info and for the fact that painted all  

  8. // Blogger SiTo // 7/23/2010

    Interesting project, I've included in my blog post about this kind of content managers


  9. // Anonymous unwiredbrain // 12/05/2010

    Even smaller! (Well, sort of)

  10. // Anonymous Anonymous // 5/19/2011

    not quite minimal enough for some of us on shared hosts with php as cgi ... and a mysql shared with lots of other sites can often be way too slow.

    I was actually searching for a slimmer php and ended up here. (or perl - I'd be happy with either if i could get the interpreter down below 100kB or so)
    ...... pretty much giving up .. going to have to move to c and maybe awk or shellscript I think! ... I need something that loads faster!

    don't get me wrong .. php and perl are great languages and I use them most of the time .. and a second or so start up time might be tolerable for the average human, but not for a web service api that gets hit several times a second!  

  11. // Anonymous Phil // 2/29/2012

    Hi Vlad,

    Have you taken a look at Textpattern. I have a few sites that use it as a CMS including one http://www.caravan-news.co.uk that also uses your Golden Grid system. It is much simpler than Joomla, Drupal etal.



  12. // Blogger Vladimir // 2/29/2012

    @Phil : Nice Work! No, I haven't try Textpattern, I usually hand code everything.  

Post a Comment

<< Home

RSS IconTwitter icon Twitter icon Twitter icon

About Me <<<

Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...

My projects <<<

§§Previous Posts <<<

Hand Drawn Icons

Other Profiles <<<

View Vladimir Carrer's profile on LinkedIn

Content is licensed under a Creative Commons Public Domain License