1 (edited by visal 2013-05-26 07:14)

Topic: punBB Evolution

I got bored, so today I decided to reprogram the whole punBB from scratch.
Basically, it is a whole new code with the same database structure like punBB
This is what I have gotten so far. (After I finish the core functionality, I will
post the whole source code)

Architecture - Theme

  • Each page consists of collection of widget.

  • Theme is a collection of pages


Simplify the code for each page by breaking down logic into many small pieces of widget.
Each widget loads it own data and has its own interface. Its interface can be overrided by
theme manager.

For example:
Code for main page


    // Load widgets
    $template->load('main', array(
        new Widget('Header', array(
                "title" => "punBB Evolution",
                "meta_desc" => "This is meta description",
                "meta_keyword" => "This is keyword"
        new Widget('ForumMenu', array("selected" => "Index")),
        new Widget('ForumList')
    // Process the template and all widget inside the
    // templates


<!doctype html>
        <link rel='stylesheet' href='<?php echo $template_base ?>/styles.css'>
        <?php $this->widget("Header"); ?>
        <div id='punbb-wrap'>
            <?php $this->widget("ForumMenu"); ?>
            <?php $this->widget("ForumList"); ?>

As you can see, template (templates/default/main.php) is the one who specify the position of each widget,
while page (index.php) specify which widgets are needed.

(Continue to next post)


Re: punBB Evolution

New Interface (mock-up only)

3 (edited by visal 2013-05-26 07:20)

Re: punBB Evolution

Architecture - Create Widget

Widget can be easily created by extend the WidgetBase class and put
it at the right folder position.

For example:


class HeaderWidget extends WidgetBase {
    public function load($data) {
        // do something here
        // do more thing here



    <title><?php echo $title; ?></title>
    <meta name="Keywords" content="<?php echo $meta_keyword ?>">
    <!-- etc .... -->

4 (edited by visal 2013-05-26 07:01)

Re: punBB Evolution

Architecture - Override Widget's Interface

Each widget comes with its own interface, but can be override by template by
have the right file name at the template folder.

For example:


<!-- Override the HeaderWidget default interface -->

5 (edited by visal 2013-05-26 07:04)

Re: punBB Evolution

Architecture - Database Layer

The whole script will be relied on the tiny wrapper around PDO.

Architecture - Cache

Architecture - Post Format
Undecided, maybe using Markdown instead of BBCode.

Architecture - Extension Manager

6 (edited by visal 2013-05-26 07:12)

Re: punBB Evolution

Additional Features

  • Use Gravatar as default avatar

  • Login from social network site (Facebook, etc...)

  • (Reserved for undecided features)


Re: punBB Evolution



Re: punBB Evolution

I like the idea, don't like the interface. Maybe a repo on GitHub?

9 (edited by visal 2013-05-26 09:50)

Re: punBB Evolution

Trace wrote:

I like the idea, don't like the interface. Maybe a repo on GitHub?

I am planning to have it on GitHub once I have some core functionality done. It would be shameful to post something that is not functional yet (4 hours of works so far). Thank for response.


Re: punBB Evolution

GitHub is to help you in the development. Not only to show your code.


Re: punBB Evolution

I have put it in GitHub, but it is very incomplete and hopefully you won't laugh at my code. I usually do solo programming, I rarely program with other programmer.



Re: punBB Evolution

Why have you named this as "PunBB" if it is a separated software? smile


Re: punBB Evolution

Well, because I purely use punBB database structure without any modification yet.


Re: punBB Evolution

Are you still working on it? smile

Re: punBB Evolution

where demo sir?

sorry my BAD english T___T
Have a nice day >.<