function checkTables() { global $xoopsModule, $oAdminButton; xoops_cp_header(); smartsection_adminmenu(-1, _AM_SSECTION_DB_CHECKTABLES); //1. Determine previous release if (!smartsection_TableExists('smartsection_meta')) { $ver = '0.93'; } else { if (!($ver = smartsection_GetMeta('version'))) { echo 'Unable to determine previous version.'; } } $currentVer = round($xoopsModule->getVar('version') / 100, 2); printf('<h2>' . _AM_SSECTION_DB_CURRENTVER . '</h2>', $currentVer); printf('<h2>' . _AM_SSECTION_DB_DBVER . '</h2>', $ver); if ($ver == $currentVer) { //No updates are necessary echo '<div>' . _AM_SSECTION_DB_NOUPDATE . '</div>'; } elseif ($ver < $currentVer) { //Needs to upgrade echo '<div>' . _AM_SSECTION_DB_NEEDUPDATE . '</div>'; echo '<div style="line-height: 20px; font-size: 16px; padding-bottom: 10px; padding-top:10px; color: red; font-weight: bold;">' . _AM_SSECTION_DB_NEEDUPDATE_WARNING . '</div>'; echo "<form method=\"post\" action=\"upgrade.php\"><input type=\"hidden\" name=\"op\" value=\"upgradeDB\" /><input type=\"submit\" value=\"" . _AM_SSECTION_DB_UPDATE_NOW . "\" /></form>"; } else { //Tried to downgrade echo '<div>' . _AM_SSECTION_DB_NEEDINSTALL . '</div>'; } smart_xoops_cp_footer(); }
// cp_functions will be loaded by /system/admin.php, so prevent initial load include_once "admin_header.php"; include_once XOOPS_ROOT_PATH . "/kernel/module.php"; $xoopsModule = XoopsModule::getByDirname("smartsection"); if (file_exists(SMARTSECTION_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/modinfo.php')) { include_once SMARTSECTION_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/modinfo.php'; } else { include_once SMARTSECTION_ROOT_PATH . 'language/english/modinfo.php'; } if (file_exists(SMARTSECTION_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/admin.php')) { include_once SMARTSECTION_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/admin.php'; } else { include_once SMARTSECTION_ROOT_PATH . 'language/english/admin.php'; } ob_start(); smartsection_adminmenu(0, _AM_SSECTION_OPTS); $btnsbar = ob_get_contents(); ob_end_clean(); //smartsection_adminmenu(0, 'preferences'); function addAdminMenu($buf) { global $btnsbar; $pattern = array("#admin.php?#", "#(<div class='content'>)#"); $replace = array("preferences.php?", " \$1 <br />" . $btnsbar . "<div style='clear: both' class='content'>"); $html = preg_replace($pattern, $replace, $buf); return $html; // ereg("(.*)(<div class='content'>.*)",$buf,$regs); // return $regs[1].$btnsbar.$regs[2]; } /* * Display and capture preferences screen