<?php require_once 'admin.inc.php'; require_once '../include/navigate.class.php'; $curpage = $_GET["p"]; $curpage = isset($curpage) && is_numeric($curpage) ? $curpage : 1; if ($curpage < 1) { $curpage = 1; } $siteconfig = getset("siteurl"); $navdata = new Navigate(); $navcount = $navdata->GetNavigateList(); $total = count($navcount); $take = 20; $skip = ($curpage - 1) * $take; $totalpage = (int) ($total % $take == 0 ? $total / $take : $total / $take + 1); $navlist = $navdata->TakeNavigateList(false, $skip, $take); $action = $_POST["action"]; if ($action == "update") { $idarr = $_POST["chk"]; if (count($idarr) > 0) { foreach ($idarr as $id) { $name = $_POST["name"]; $url = $_POST["url"]; $order = $_POST["order"]; $group = $_POST["group"]; if (is_numeric($id)) { $sql = "update yiqi_navigate set `name`='" . $name[$id] . "',`url`='" . $url[$id] . "',`displayorder`='" . $order[$id] . "',`group`='" . $group[$id] . "' WHERE `navid` = '{$id}' limit 1"; $yiqi_db->query(CheckSql($sql)); } }
<?php require_once VI_ROOT . "source/class/navigate.php"; //模块ID $appid = getgpc('appid'); //配置地址 $self = VI_ROOT . 'module/' . $appid . '/config.php'; //加载导航 include 'include/naver.setting.php'; if ($appid && file_exists($self) && (require $self)) { //模块配置 $app = $_G['module'][$appid]; //权限名称 $func = 'system-' . $app['model'] . '-set'; //检查权限 System::check_func($func, FALSE); $_GalSet = new Navigate(VI_ROOT . 'module/' . $appid . '/navigate.php', VI_ROOT . 'module/' . $appid . '/navigate.xml', $appid); if ($_GET["action"] == "update" && !empty($_POST)) { if ($_GalSet->save('POST')) { //连接数据库 System::connect(); //写入日志 System::insert_event($func, time(), time()); //关闭数据库 System::connect(); echo '<div id="state">成功修改模块配置,新配置将立即生效</div>'; } else { echo "<div id='state' class='failure'>保存模块配置失败!请检查 ./module/" . $appid . "/navigate.php 是否有读写权限</div>"; } } elseif ($_GalSet->writable() == FALSE) { echo "<div id='state' class='failure'>请检查 ./module/" . $appid . "/navigate.php 是否有读写权限</div>"; }