 |
 |
 |
 |
 |
| Author |
Message |
lexa
Creator of CuteNews.RU

Joined: 02 Oct 2005 Posts: 90 Location: St.-Petersburg, Russia |
|
Few words about Blueberry |
|
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 ).
Blueberry.Tags its templater with XML like syntax.
 |  | <tagname param1="value1" param2="value2">Sometext</tagname> |
Parse in PHP
 |  | echo tag_tagname(array('param1' => 'value1', 'param2' => 'value2', '#text' => 'Sometext')); |
Or
 |  | <tagname param1="value1" param2="value2" /> |
to
 |  | echo tag_tagname(array('param1' => 'value1', 'param2' => 'value2')); |
Very simple.
Ok. Now real example. Make simple calendar.
Get PHP array
 |  | <?
$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
 |  | <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
 |  | <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
 |  | <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
 |  | <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).
|
|
| Sun May 25, 2008 2:39 pm |
 |
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1843 Location: US |
|
|
|
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
Keep us updated dude!
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Sun May 25, 2008 5:59 pm |
|
 |
lexa
Creator of CuteNews.RU

Joined: 02 Oct 2005 Posts: 90 Location: St.-Petersburg, Russia |
|
|
|
I show why it real simple. Compare with calendar function from CuteNews.ru/Strawberry. plugins/etc.php (line ~293):
 |  | 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).'">«</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).'">»</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.'"> ';
}
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).'"> ';
}
return $buffer.'</table>';
} |
OMG!!! 
|
|
| Sun May 25, 2008 10:02 pm |
 |
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
 |
 |
 |
|