More solutions for idle CPU time.
Submitted by phrax on Tue, 2004-11-02 15:17.
Wonky Code
Yesterday we had a great example of how to make sure your database isn't slacking off. Here's a example to make sure your web server keeps working hard too.
Also thanks to everybody who submitted a WTF. Keep them coming! :)
<?php
if( $_USER['uid'] > 1 )
{
$usermenu = new Template( $_CONF['path_layout'] );
$usermenu->set_file( array( 'option' => 'useroption.thtml',
'current' => 'useroption_off.thtml' ));
$usermenu->set_var( 'site_url', $_CONF['site_url'] );
$usermenu->set_var( 'layout_url', $_CONF['layout_url'] );
<strong>$usermenu->set_var( 'block_name', str_replace( '_', '-', 'user_block' ));</strong>
if( empty( $title ))
{
$title = DB_getItem( $_TABLES['blocks'], 'title', "name='user_block'" );
}
//....
?>