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

http://s14.postimg.org/6rtblmnqp/page_widget.png

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

index.php

    // 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
    $template->show();

templates/default/main.php

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

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)

2

Re: punBB Evolution

New Interface (mock-up only)
http://s17.postimg.org/61pb72b3j/This_is_testing.png

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:

widget/Header/core.php

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

        $this->show($data);
    }
}

widget/Header/template.php

    <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:

templates/default/HeaderWidget.php

<!-- 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
Undecided

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

Architecture - Extension Manager
Undecided

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)

7

Re: punBB Evolution

(Reserved)

8

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.

10

Re: punBB Evolution

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

11

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.

https://github.com/invisal/punbbevolution

12

Re: punBB Evolution

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

13

Re: punBB Evolution

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

14

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 >.<
(^____^)v