function dhTheme($theme) { global $root; static $current = ''; if (empty($current)) { $current = dhConfig('siteTheme'); } require_once "{$root}/themes/{$current}/{$theme}.php"; }
function dhUrl($action, $params = array()) { if (dhConfig('useModRewrite')) { if ($action == 'index') { $uri = "/"; } else { $uri = "/{$action}"; } if ($params && $action != 'index') { $uri .= '/' . implode('/', $params); } } else { $uri = "/{$action}.php"; if ($params) { $uri .= '?' . http_build_query($params); } } return $uri; }
<?php $root = realpath(dirname(__FILE__)); include_once "{$root}/config.php"; include_once "{$root}/common.php"; if (!dhIsLogin()) { dhRedirect('index'); } if (dhIsPost()) { if (dhValid(array('netname' => 'required'))) { $netname = dhPost('netname', 'WORKGROUP'); dhQueryInsert('networks', array('id_users' => dhUID(), 'netname' => $netname, 'created' => time())); if (dhConfig('useModRewrite')) { dhRedirect('networks'); } else { dhRedirect('networks', array('success' => urlencode($netname))); } } } dhTheme('networks-add');
"> <div id="header-region" class="clear-block"></div> <div id="wrapper"> <div id="container" class="clear-block"> <div id="header"> <div id="logo-floater"><h1><a href="<?php echo dhUrl('index'); ?> " title="<?php echo dhConfig('siteName'); ?> "><img src="/themes/garland/images/logo.png" alt="<?php echo dhConfig('siteName'); ?> " id="logo" /><span><?php echo dhConfig('siteName'); ?> </span></a></h1></div> </div> <?php if (dhIsLogin()) { ?> <div id="sidebar-left" class="sidebar"> <div class="clear-block block block-user"> <h2>joksnet</h2> <div class="content"> <ul class="menu"> <li class="leaf first<?php echo dhIsUrl('index') ? ' active-trail' : ''; ?> "><a href="<?php