function at_rendertime_stop($vars) { $renderstart = atRunningGetVar("renderstart"); $mtime = explode(" ", microtime()); $renderstop = $mtime[1] + $mtime[0]; $rendertime = $renderstop - $renderstart; printf('<div align="center">' . _AT_PAGECREATED . " %f " . _AT_SECONDS . '</div>', $rendertime); }
function themesidebox($title, $content) { $block = atRunningGetVar("block"); $block['title'] = $title; $block['content'] = $content; if ($block['position'] == "d") { $block['position'] = "c"; } atThemeBlock($block); }
// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // To read the license please visit http://www.gnu.org/copyleft/gpl.html // // // ---------------------------------------------------------------------- require_once "modules/AutoTheme/includes/atAPI.php"; $runningconfig = atThemeInit($thename); $bgcolor1 = atRunningGetVar("bgcolor1"); $bgcolor2 = atRunningGetVar("bgcolor2"); $bgcolor3 = atRunningGetVar("bgcolor3"); $bgcolor4 = atRunningGetVar("bgcolor4"); $textcolor1 = atRunningGetVar("textcolor1"); $textcolor2 = atRunningGetVar("textcolor2"); if (!function_exists("OpenTable")) { function OpenTable() { $runningconfig = atGetRunningConfig(); extract($runningconfig); if ($template['table1']) { $file = $template['table1']; $template = atTemplateCompile($themepath . $file); list($output, $close) = atTemplateSplit($template, "table-content"); atTemplateDisplay($output); } else { echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"{$tblcolor1}\"><tr><td>\n"; echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" bgcolor=\"{$tblcolor2}\"><tr><td>\n"; } }
function at_config_display() { if (!atIsAdminUser()) { return; } $runningconfig = atGetRunningConfig(); extract($runningconfig); if (isset($_GET['at_admin'])) { ob_end_clean(); OpenTable(); eval($command['print-link']); echo "<h1>AutoTheme</h1><br />"; switch ($_GET['at_admin']) { case "cmds": echo "<h2>" . _AT_LOADEDCOMMANDS . "</h2>"; $commands = atRunningGetVar("command"); foreach ($runningconfig as $cmd => $action) { $vars = " echo \${$cmd};"; } $commands = array_merge((array) $commands, (array) $vars); echo "<table border=\"1\" width=\"100%\"><tr><td><b>" . _AT_COMMAND . "</b></td><td width=\"50%\"><b>" . _AT_ACTION . "</b></td><td width=\"50%\"><b>" . _AT_RESULT . "</b></td></tr>"; foreach ($commands as $cmd => $action) { ob_start(); eval($action); $result = ob_get_contents(); ob_end_clean(); echo "<tr><td valign=\"top\">{$cmd}</td><td valign=\"top\">" . htmlentities($action) . "</td><td valign=\"top\"> {$result}</td></tr>"; } echo "</table>"; break; case "at": // echo "<h2>" . _AT_CONFIG . "</h2>"; echo "<table border=\"1\" width=\"100%\"><tr><td><b>" . _AT_NAME . "</b></td><td><b>" . _AT_VALUE . "</b></td></tr>"; $atconfig = atGetAutoConfig(); foreach ($atconfig as $name => $val) { if (is_array($val)) { ob_start(); at_array_display($val); $result = ob_get_contents(); ob_end_clean(); } else { $result = $val; } echo "<tr><td valign=\"top\">{$name}</td><td valign=\"top\">{$result}</td></tr>"; } echo "</table>"; break; case "theme": echo "<h2>" . _AT_THEMECONFIG . "</h2>"; echo "<table border=\"1\" width=\"100%\"><tr><td><b>" . _AT_NAME . "</b></td><td><b>" . _AT_VALUE . "</b></td></tr>"; $themeconfig = atGetThemeConfig(); foreach ($themeconfig as $name => $val) { if (is_array($val)) { ob_start(); at_array_display($val); $result = ob_get_contents(); ob_end_clean(); } else { $result = $val; } echo "<tr><td valign=\"top\">{$name}</td><td valign=\"top\">{$result}</td></tr>"; } echo "</table>"; break; case "running": echo "<h2>" . _AT_RUNNINGCONFIG . "</h2>"; echo "<table border=\"1\" width=\"100%\"><tr><td><b>" . _AT_NAME . "</b></td><td><b>" . _AT_VALUE . "</b></td></tr>"; $runningconfig = atGetRunningConfig(); foreach ($runningconfig as $name => $val) { if (is_array($val)) { ob_start(); at_array_display($val); $result = ob_get_contents(); ob_end_clean(); } else { $result = $val; } echo "<tr><td valign=\"top\">{$name}</td><td valign=\"top\">{$result}</td></tr>"; } echo "</table>"; break; } CloseTable(); die; } }
function AutoTheme_admin_atmain($var) { $var = atExportVar($var); extract($var); if (@file_exists(AT_DIRPREFIX . "themes/{$themedir}/theme.cfg")) { include AT_DIRPREFIX . "themes/{$themedir}/theme.cfg"; } elseif (@file_exists("{$themedir}/theme.cfg")) { include "{$themedir}/theme.cfg"; } if (isset($import)) { if ($import == "skip") { $var = compact("themedir"); atSaveThemeConfig($themedir, $var); return AutoTheme_admin_atmain($var); } else { $var = compact("themedir", "import"); AutoTheme_admin_import($var); $var = compact("themedir"); return AutoTheme_admin_atmain($var); } } atAdminThemeLinks($themedir, "", $var); $adminlinks = "" . AT_ADMINPAGE . "?module=AutoTheme"; atAdminOpenTable(); $pathparts = explode("/", $themedir); $thistheme = array_pop($pathparts); if (atRunningGetVar("thename") == $thistheme && !isset($edit)) { echo "<b>" . _AT_NOTICE . ":</b> " . _AT_ACTIVETHEMEMSG . "<br /><br />" . "[ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=atmain&themedir={$themedir}&edit=1\">" . _AT_CONTINUE . "</a> ]" . " [ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=athemes\"><b>" . _AT_CANCEL . "</b></a> ]"; atAdminCloseTable(); atAdminFooter(); return; } if (is_array($block_display) || is_array($miscellaneous)) { echo "<b>" . _AT_NOTICE . ":</b> AT-Lite .6 - " . _AT_OLDTHEMEMSG . "<br /><br />" . "[ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=atmain&themedir={$themedir}&import=lite_6\">" . _AT_IMPORT . "</a> ]" . " [ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=atmain&themedir={$themedir}&import=skip\">" . _AT_SKIP . "</a> ]" . " [ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=athemes\"><b>" . _AT_CANCEL . "</b></a> ]"; atAdminCloseTable(); atAdminFooter(); return; } elseif (!isset($atversion)) { echo "<b>" . _AT_NOTICE . ":</b> AutoTheme 1.0 - " . _AT_OLDTHEMEMSG . "<br /><br />" . "[ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=atmain&themedir={$themedir}&import=1_0\">" . _AT_IMPORT . "</a> ]" . " [ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=atmain&themedir={$themedir}&import=skip\">" . _AT_SKIP . "</a> ]" . " [ <a href=\"" . AT_ADMINPAGE . "?module=AutoTheme&op=athemes\"><b>" . _AT_CANCEL . "</b></a> ]"; atAdminCloseTable(); atAdminFooter(); return; } echo "<b><a href=\"{$adminlinks}&op=general&themedir=" . htmlentities(urlencode($themedir)) . "\">" . _AT_THEMEDEF . "</a></b></td><td>" . _AT_GENDESCR . "</td></tr>\n" . "<tr><td><b><a href=\"{$adminlinks}&op=modmain&themedir=" . htmlentities(urlencode($themedir)) . "\">" . _AT_CUSTMODULES . "</a></b></td><td>" . _AT_MODDESCR . "</td></tr>\n" . "<tr><td><b><a href=\"{$adminlinks}&op=ablocks&themedir=" . htmlentities(urlencode($themedir)) . "\">" . _AT_AUTOBLOCKS . "</a></b></td><td>" . _AT_THEMEABDESCR . "</td></tr>\n" . "<tr><td><b><a href=\"{$adminlinks}&op=cmdedit&themedir=" . htmlentities(urlencode($themedir)) . "\">" . _AT_COMMANDS . "</a></b></td><td>" . _AT_THEMECMDDESCR; $autoconfig = atGetAutoConfig(); extract($autoconfig); if (!($ext = atAutoGetVar("extra"))) { echo $extradir; list($ext, $cmd) = atExtraScan($extradir); } if (!$ext) { return; } foreach ($ext as $id => $info) { if ($info['themeadmin'] && function_exists($info['themeadmin']) && $autoextra[$id]) { echo "<tr><td><b><a href=\"{$adminlinks}&op=extraops&extraname=" . htmlentities(urlencode($id)) . "&themedir=" . htmlentities(urlencode($themedir)) . "\">" . $info['name'] . "</a></b></td><td>" . $info['description'] . "</td></tr>\n"; } } atAdminCloseTable(); atAdminFooter(); //atFixupThemeConfig($themedir); }
function atGetBlockConfig($blockcontrol = null) { if (!$blockcontrol) { $blockcontrol = atRunningGetVar('blockcontrol'); } $blocks = atGetBlocks(); if (is_array($blockcontrol)) { foreach ($blocks as $title => $block) { if (isset($blockcontrol[$title])) { $blocklist[$title] = array_merge((array) $block, (array) $blockcontrol[$title]); } else { $blocklist[$title] = $block; } } } else { $blocklist = $blocks; } uasort($blocklist, 'at_block_sort'); return $blocklist; }