Few words about Blueberry

Talk about everything not related to the script.

Few words about Blueberry

Postby lexa » Sun May 25, 2008 2:39 pm

Hello.

I have say few words about Blueberry. It new engine, it 0.1.* versions, and it very alfa versions. But now Blueberry it my personal playground. For fun.

Before i have say:
1. it GNU GPL;
2. it alfa;
3. it only russian now;
4. it no have any docs.

In Blueberry exists cool idea: make HTML. Just HTML and litle PHP. You write HTML and you make site. You write HTML and you make relations between MySQL tables. You write HTML and you make tree structure MySQL table. You write HTML and you make himself columns (without xFields). All tables and columns it "xFields", but it real tables and columns. It personal tables and columns. Write you HTML code you write 90% original site. With blackjack and whores. :)

Ok. Some fun features. Blueberry.Tags. It HTML++ or HTML# (on MS Windows :roll:). :)

Blueberry.Tags its templater with XML like syntax.
Code: Select all
<tagname param1="value1" param2="value2">Sometext</tagname>

Parse in PHP
Code: Select all
echo tag_tagname(array('param1' => 'value1', 'param2' => 'value2', '#text' => 'Sometext'));

Or
Code: Select all
<tagname param1="value1" param2="value2" />

to
Code: Select all
echo tag_tagname(array('param1' => 'value1', 'param2' => 'value2'));


Very simple.

Ok. Now real example. Make simple calendar.

Get PHP array
Code: Select all
<?
$date   = mktime(0, 0, 0, 05, 1, 2008);
$days    = date('t', $date);
$offset = date('w', $date) - 1;
$weeks    = ceil(($days + $offset) / 7);

l('calendar.month.this.name', l_date('%B', $date));
l('calendar.month.this.link', date('Y/m', $date));

$prev = strtotime('-1 month', $date);
l('calendar.month.prev.name', l_date('%B', $prev));
l('calendar.month.prev.link', date('Y/m', $prev));

$next = strtotime('+1 month', $date);
l('calendar.month.next.name', l_date('%B', $next));
l('calendar.month.next.link', date('Y/m', $next));


for ($i = 0; $i < $weeks; $i++)
    for ($j = 1; $j <= 7; $j++){
        $day = ($i * 7 + $j - $offset);

        if ($day > 0 and $day <= $days)
            l('calendar.days.'.$day, ($j >= 6 ? 'weekend' : 'workday'));
        else
            l('calendar.days.'.($day - 100), false);
    }
?>

l('calendar') it alias $GLOBALS['calendar']. Dot it l() function it key in array. l('key1.key2.key3') => $GLOBALS['key1']['key2']['key3'].

Write CSS
Code: Select all
<style>
    .calendar th {
        font-size: 13px;
    }

    .calendar td {
        font-size: 12px;
        text-align: center;
    }

    .calendar .workday {
    }

    .calendar .weekend, .calendar .weekend a {
        color: #800040;
    }

    .calendar .monthlist {
        font-size: 11px;
    }
</style>


And now write HTML
Code: Select all
<table class="calendar">
    <tr />
        <td colspan="2" class="monthlist" />
            <a href="${calendar.month.prev.link}">&laquo; ${calendar.month.prev.name}</a>

        <th colspan="3" />${calendar.month.this.name}

        <td colspan="2" class="monthlist" />
            <a href="${calendar.month.next.link}">${calendar.month.next.name} &raquo;</a>

    <tr />
        <th class="workday" />Пн <!-- monday -->
        <th class="workday" />Вт <!-- tuesday -->
        <th class="workday" />Ср <!-- etc. -->
        <th class="workday" />Чт
        <th class="workday" />Пт
        <th class="weekend" />Сб
        <th class="weekend" />Вс

    <tr />
        <loop each="${calendar.days} as day => class">
            <td if="%{day} <= 0">&nbsp;</td>

            <td  class="%{class}" if="%{day} > 0">%{day}</td>

            <tr every="7" />
        </loop>
</table>

OMG!!!11111 I working. :)

Simple and cool, i think... No?

Image

Example 2. Make list links from OPML file
Code: Select all
<opml src="path/or/URL/to/file.opml">
    <li>
        <a href="%{opml.htmlUrl}">%{opml.title}</a> [<a href="%{opml.xmlUrl}">feed</a>]
    </li>
</opml>

And we have some like this
Code: Select all
<li>
    <a href="http://example.com">Example page</a> [<a href="http://example.com/rss.xml">feed</a>]
</li>
<li>
    <a href="http://example2.com">Example 2 page</a> [<a href="http://example2.com/rss.xml">feed</a>]
</li>
...
<li>
    <a href="http://exampleN.com">Example N page</a> [<a href="http://exampleN.com/rss.xml">feed</a>]
</li>


Now in Blueberry exists funny tags (like GameQ class) and serious (like make database from HTML. It core functions).

P.S. Now i hard work with Blueberry. I hope Blueberry to be good CMS (CMF, acronym not important).
User avatar
lexa
Creator of CuteNews.RU
 
Posts: 94
Joined: Sun Oct 02, 2005 2:55 am
Location: St.-Petersburg, Russia

Postby scottdallas » Sun May 25, 2008 5:59 pm

That all sounds wonderful. As long as I can keep making my own layout for my site, then including your beautiful CMS's into them.. they sound awesome.

All your 'simple' examples seem way above my head lol. I think what is 'simple' to you is very complicated to many others. If not, well then it's just me :P

Keep us updated dude!
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby lexa » Sun May 25, 2008 10:02 pm

I show why it real simple. Compare with calendar function from CuteNews.ru/Strawberry. plugins/etc.php (line ~293):
Code: Select all
function calendar($cal_month, $cal_year, $events, $prev_next){
global $year, $month, $day, $PHP_SELF;

    $first_of_month  = mktime(0, 0, 0, $cal_month, 7, $cal_year);
    $maxdays         = date('t', $first_of_month) + 1; // 28-31
    $cal_day         = 1;
    $weekday         = date('w', $first_of_month); // 0-6

    if (is_array($prev_next)){
       sort($prev_next);

       foreach ($prev_next as $key => $value){
           if ($value < $first_of_month){
              $prev_of_month = $prev_next[$key];
           }
       }

       rsort($prev_next);

       foreach ($prev_next as $key => $value){
           if ($value > $first_of_month){
              $next_of_month = $prev_next[$key];
           }
       }
    }

    if ($prev_of_month){
       $tomonth['prev'] = '<a href="'.cute_get_link(array('date' => $prev_of_month), 'month').'" title="'._etc_lang(date('n', $prev_of_month), 'month').date(' Y', $prev_of_month).'">&laquo;</a> ';
    }

    if ($next_of_month){
       $tomonth['next'] = ' <a href="'.cute_get_link(array('date' => $next_of_month), 'month').'" title="'._etc_lang(date('n', $next_of_month), 'month').date(' Y', $next_of_month).'">&raquo;</a>';
    }

    $buffer = '<table id="calendar">
    <tr>
     <td colspan="7" class="month">'.$tomonth['prev'].'<a href="'.cute_get_link(array('date' => $first_of_month), 'month').'" title="'._etc_lang(date('n', $first_of_month), 'month').date(' Y', $first_of_month).'">'._etc_lang(date('n', $first_of_month), 'month').' '.$cal_year.$tomonth['next'].'</a>
    <tr>
     <th class="weekday">'._etc_lang(1, 'weekday').'
     <th class="weekday">'._etc_lang(2, 'weekday').'
     <th class="weekday">'._etc_lang(3, 'weekday').'
     <th class="weekday">'._etc_lang(4, 'weekday').'
     <th class="weekday">'._etc_lang(5, 'weekday').'
     <th class="weekend">'._etc_lang(6, 'weekday').'
     <th class="weekend">'._etc_lang(7, 'weekday').'
    <tr>';

    if ($weekday > 0){
       $buffer .= '<td colspan="'.$weekday.'">&nbsp;';
    }

    while ($maxdays > $cal_day){
        if ($weekday == 7){
            $buffer .= '<tr>';
            $weekday = 0;
        }

        # В данный день есть новость
        if ($events[$cal_day]){
            $date['title'] = langdate('l, d M Y', $events[$cal_day]);
            $link = cute_get_link(array('date' => $events[$cal_day]), 'day');

            if ($weekday == '5' or $weekday == '6'){ // Если суббота и воскресенье. Слава КПСС!!!
            if ($day == $cal_day){
               $buffer .= '<td class="weekend"><a href="'.$link.'" title="'.$date['title'].'"><b>'.$cal_day.'</b></a>';
                  } else {
                     $buffer .= '<td class="endday"><a href="'.$link.'" title="'.$date['title'].'">'.$cal_day.'</a>';
                  }
            } else { // Рабочии дни. Вперёд, стахановцы!!!
            if ($day == $cal_day){ // активный
               $buffer .= '<td class="weekday"><a href="'.$link.'" title="'.$date['title'].'"><b>'.$cal_day.'</b></a>';
            } else {  // пассивный, дурашка
               $buffer .= '<td class="day"><a href="'.$link.'" title="'.$date['title'].'">'.$cal_day.'</a>';
            }
            }
        } else { // В данный день новостей нет. Хуйовый день...
           if ($weekday == '5' or $weekday == '6'){ // дни, когда по телеку нихуя нет :(
               $buffer .= '<td class="endday">'.$cal_day;
           } else { // работяги хлещат водку после труда
              $buffer .= '<td class="day">'.$cal_day;
           }
        }

        $cal_day++;
        $weekday++;
    }

    if ($weekday != 7){
       $buffer .= '<td colspan="'.(7 - $weekday).'">&nbsp;';
    }

return $buffer.'</table>';
}

OMG!!! :roll: :)
User avatar
lexa
Creator of CuteNews.RU
 
Posts: 94
Joined: Sun Oct 02, 2005 2:55 am
Location: St.-Petersburg, Russia

Postby Ramon » Mon Dec 22, 2008 3:21 am

Sounds good lexa. Any updates on this?
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby lexa » Mon Dec 22, 2008 3:43 am

Thank you for question.

Yes, i try update Blueberry every day in SVN. And think about make 0.2.* versions: with usergroups, permissions and other access rules.

I trying make some sites with Blueberry and it working fine (my blog and my work site (sketch)). I made this sites quickly and feel funny.

For this time i made langs, configs, some features for work with databases (like table/column aliases for simple integration to forums, blogs, etc.), steal some features from another engines :roll:, etc.

Later i make wiki with docs on english (my english sucks and i hope guys help me with it, but english do default) and russian langs.

P.S. Logo :)

Image
User avatar
lexa
Creator of CuteNews.RU
 
Posts: 94
Joined: Sun Oct 02, 2005 2:55 am
Location: St.-Petersburg, Russia

Postby Ramon » Mon Dec 22, 2008 4:07 pm

Good to hear your still working on it. Looks very promising indeed. Will there be a "plugin" feature?

"like table/column aliases for simple integration to forums, blogs, etc." Will it also be more easy to integrate the other way around. Let's say, will it be possible to use your user database from your forums for BlueBerry?
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby lexa » Tue Dec 23, 2008 3:18 am

Not sure about plugin system now. I think about two ways:
1. Hook system like Drupal. And light version it exists now.
2. Hook system like WordPress, Aj-Fork (in Strawberry this system).

For example. We have file Tags.php it php Class for namespace (tags::SomeFunctoin()). tags::parse() parsing templates like:
Code: Select all
<b>Hello</b>

In php tag <b /> is function:
Code: Select all
function tag_b($attr){


And is a first way. I think it good way for tags.php and some another thinks where not need many hooks to one actions. But some time need many hooks:
Code: Select all
$db = sql('bla bla'); // is a array from database
$db = hook_get('action', $db); // is a hooks on the action


And in php:
Code: Select all
hook_set('action', 'function_name', 1); // third param is priority
function function_name($db_array, $hook_name){ // here $hook_name is "action"
// some code
}

hook_set('action', 'function_name2', 2);
function function_name2($db_array, $hook_name){ // here $hook_name is "action" too
}


Blueberry now has extension system too. 2 types extensions it modules and exts: first like PHP Nuke system - we go to URL http://example.com/MODULE/ACTION or http://example.com/MODPACK/MODULE/ACTION and get module/action/. Second is a additional functions, tags, first way hooks, etc.

Ol. About integration. It is a plan: Blueberry may use not self tables, columns and databases too (for one database host). Example: we have databases forums and blueberry. But tables for users in this databeses hфs different names - in forums it users, in blueberry it user. Columns names different too.

In Blueberry we make for table user alias "users", and for columns aliases: name => "realname", id => "user_id", group.id => "group_id", etc. And Blueberry wiil be use table user like users, column name like realname. But for this queries like "select * from" not working. Need use "select id, name from" (and it very good for MySQL).

In forum need use standart (forum engine) functions. Just we have one DB users for Blueberry and for forum.
User avatar
lexa
Creator of CuteNews.RU
 
Posts: 94
Joined: Sun Oct 02, 2005 2:55 am
Location: St.-Petersburg, Russia

Postby Ramon » Mon Apr 27, 2009 11:06 am

Any progress on this lexa?
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby lexa » Tue Apr 28, 2009 1:53 am

Some litle progress. :)

My english very bad for explain what i planed. Simple explane: i made framework Berry (think about it long time). On this framework based Blueberry, but this engine stay for me because it engine like a platform (for codding; now Blueberry for my work). And on Berry i make Strawberry 2.0 for every (because with admin panel :)).

Sketchs for Strawberry 2:
http://strawberry.goodgirl.ru/forum/topic/3426/ (gallery admin)
http://strawberry.goodgirl.ru/forum/topic/3428/ (for icons with rabbits, 2.0 too :), now absolutly mine - i mean special for Strawberry)
http://strawberry.goodgirl.ru/forum/topic/3427/ (Strawberry`s logos)

Is sketchs. If you wont i post all sketchs here for english discussion and listen ideas.
User avatar
lexa
Creator of CuteNews.RU
 
Posts: 94
Joined: Sun Oct 02, 2005 2:55 am
Location: St.-Petersburg, Russia

Postby Torstein » Tue Apr 28, 2009 9:41 am

I'm looking forward to this, but:

I hope you're planning to focus a bit more on the English version this time around, maybe going back to the way you used to enable alternative translations in CNR.

I also hope that you'll include mass-uploading and sub-sub-etc folders for the gallery - and make plugins for cutenews.ru/Strawebwerry 1.2 compatible or easy to make compatible.
Torstein
 
Posts: 292
Joined: Thu Aug 03, 2006 11:19 pm

Postby lexa » Wed Apr 29, 2009 11:45 pm

Make plugins compatible is imposible. :(

English language making by default. 100% inluded in every release.

Sub-sub-sub folders for gallery you mean for better speed on file system or you mean for sub albums or some like that? Now i dont know how i make categorization. But i think about categories for albums and tags for each image in albums.
User avatar
lexa
Creator of CuteNews.RU
 
Posts: 94
Joined: Sun Oct 02, 2005 2:55 am
Location: St.-Petersburg, Russia

Postby Hawk » Thu Apr 30, 2009 2:32 pm

Looks interesting, keep up the good work :D
User avatar
Hawk
 
Posts: 279
Joined: Tue Aug 29, 2006 9:00 pm


Return to General chat



Who is online

Users browsing this forum: No registered users and 0 guests

cron