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
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}">« ${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} »</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"> </td>
<td class="%{class}" if="%{day} > 0">%{day}</td>
<tr every="7" />
</loop>
</table>
OMG!!!11111 I working.
Simple and cool, i think... No?

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).


