[geeklog-users] Styling Text Inside Blocks (and copyright year)

geeklog-users-admin at lists.geeklog.net geeklog-users-admin at lists.geeklog.net
Fri Apr 25 14:59:38 EDT 2003


A user wanted lines between every line in their blocks. (You can see the result at http://www.sandiego.edu/ins/insites/)

Geeklog currently takes the lines in a block and puts a <br /> between them (using nl2br). I changed lib-common.php from:

                if( substr( $blockcontent, 0, 1 ) != '<' )
                {
                    $blockcontent = nl2br( $blockcontent );
                }

to:

                if( substr( $blockcontent, 0, 1 ) != '<' )
                {
                        $blocklines = explode("\n", $blockcontent);
                        $blockclass = '<p class="blocklines">';
                        $blockcontent = $blockclass . implode("</p>$blockclass", $blocklines) . '</p>';
                }

which allows controlling the appearance of such text via the appropriate style.css.

Incidentally, the copyright year is hard-coded into lib-common.php. Shouldn't it at least be in config.php, as, perhaps, $_CONF['site_copyright']? (It might make even more sense to use the year from the most recent displayed article.)

Jerry
-- 
jerry at sandiego.edu
http://www.sandiego.edu/~jerry/
Serra 188B/x8773
--
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at and repair."--Douglas Adams (Mostly Harmless)



More information about the geeklog-users mailing list