function common_template($WebID) { global $xoopsTpl, $TadUpFiles, $xoopsDB, $menu_var; $xoopsTpl->assign('WebID', $WebID); if (!file_exists(XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/tad_web_header.html")) { output_head_file(); } if (file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/FooTable.php")) { include_once XOOPS_ROOT_PATH . "/modules/tadtools/FooTable.php"; $FooTable = new FooTable(); $FooTableJS = $FooTable->render(); } $xoopsTpl->assign('FooTableJS', $FooTableJS); /****網站設定值****/ $all = get_web_all_config($WebID); foreach ($all as $ConfigName => $ConfigValue) { $xoopsTpl->assign($ConfigName, $ConfigValue); ${$ConfigName} = $ConfigValue; } if (empty($display_blocks)) { $sql = "select bid from " . $xoopsDB->prefix("newblocks") . " where dirname='tad_web' order by weight"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); while (list($bid) = $xoopsDB->fetchRow($result)) { $display_blocks_arr[] = $bid; } } else { $display_blocks_arr = explode(',', $display_blocks); } $xoopsTpl->assign('display_blocks_arr', $display_blocks_arr); $xoopsTpl->assign('menu_var', $menu_var); $xoopsTpl->assign('bootstrap', $_SESSION['bootstrap']); }
function update_tad_web() { global $xoopsDB, $xoopsUser, $WebID; $myts =& MyTextSanitizer::getInstance(); $_POST['WebName'] = $myts->addSlashes($_POST['WebName']); $sql = "update " . $xoopsDB->prefix("tad_web") . " set\n `WebName` = '{$_POST['WebName']}'\n where WebID ='{$WebID}'"; $xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $TadUpFilesLogo = TadUpFilesLogo(); $TadUpFilesLogo->set_col('logo', $WebID, 1); $TadUpFilesLogo->del_files(); mklogoPic($WebID); $TadUpFilesLogo->import_one_file(XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/auto_logo/auto_logo.png", null, 1280, 150, null, 'auto_logo.png', false); //import_img(XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/auto_logo", "logo", $WebID); output_head_file(); }
//目前觀看的班級 if (!empty($_REQUEST['WebID'])) { $WebID = intval($_REQUEST['WebID']); $_SESSION['WebID'] = $WebID; } else { $WebID = $_SESSION['WebID']; } include_once "function.php"; include_once "class/cate.php"; if ($WebID) { $Web = getWebInfo($WebID); $WebName = $Web['WebTitle']; $WebTitle = $Web['WebTitle']; $WebOwner = $Web['WebOwner']; if (!file_exists(XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/header.png")) { output_head_file(); } } else { $Web = ""; $WebName = ""; $WebTitle = ""; $WebOwner = ""; } $i = 0; if ($WebID) { $menu_var[$i]['id'] = $i; $menu_var[$i]['title'] = _MD_TCW_CLASS_HOME; $menu_var[$i]['url'] = "index.php?WebID={$WebID}"; $menu_var[$i]['target'] = "_self"; $menu_var[$i]['icon'] = "fa-home"; $i++;