[geeklog-cvs] Geeklog-1.x/public_html/layout/professional functions.php, 1.15, 1.16
Michael Jervis
mjervis at qs1489.pair.com
Sun Aug 17 10:16:05 EDT 2008
Update of /cvsroot/geeklog/Geeklog-1.x/public_html/layout/professional
In directory qs1489.pair.com:/tmp/cvs-serv3453/public_html/layout/professional
Modified Files:
functions.php
Log Message:
Auto detect block tempaltes for left and right and fail over to them when rendering blocks for left and right.
Index: functions.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/layout/professional/functions.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** functions.php 26 Jul 2008 16:40:42 -0000 1.15
--- functions.php 17 Aug 2008 14:16:02 -0000 1.16
***************
*** 12,30 ****
}
! $lang = COM_getLanguageId();
! if (empty($lang)) {
! $result = DB_query("SELECT onleft,name FROM {$_TABLES['blocks']} WHERE is_enabled = 1");
! } else {
! $result = DB_query("SELECT onleft,name FROM {$_TABLES['blocks']}");
! }
! $nrows = DB_numRows($result);
! for ($i = 0; $i < $nrows; $i++) {
! $A = DB_fetchArray($result);
! if ($A['onleft'] == 1) {
! $_BLOCK_TEMPLATE[$A['name']] = 'blockheader-left.thtml,blockfooter-left.thtml';
! } else {
! $_BLOCK_TEMPLATE[$A['name']] = 'blockheader-right.thtml,blockfooter-right.thtml';
! }
! }
$_BLOCK_TEMPLATE['_msg_block'] = 'blockheader-message.thtml,blockfooter-message.thtml';
--- 12,24 ----
}
! /*
! * For left/right block support there is no longer any need for the theme to
! * put code into functions.php to set specific templates for the left/right
! * versions of blocks. Instead, Geeklog will automagically look for
! * blocktemplate-left.thtml and blocktemplate-right.thtml if given
! * blocktemplate.thtml from $_BLOCK_TEMPLATE. So, if you want different left
! * and right templates from admin_block, just create blockheader-list-left.thtml
! * etc.
! */
$_BLOCK_TEMPLATE['_msg_block'] = 'blockheader-message.thtml,blockfooter-message.thtml';
More information about the geeklog-cvs
mailing list