function kl_album_callback_do($hide) { global $CACHE; $DB = Database::getInstance(); $kl_album_config = Option::get('kl_album_config'); if (is_null($kl_album_config)) { $DB->query("INSERT INTO " . DB_PREFIX . "options(option_name, option_value) VALUES('kl_album_config', '{$kl_album_config}')"); $CACHE->updateCache('options'); } $isExists = false; $Navi_Model = new Navi_Model(); $navis = $Navi_Model->getNavis(); foreach ($navis as $navi) { if ($navi['url'] == '?plugin=kl_album' && $navi['isdefault'] == 'y') { $Navi_Model->updateNavi(array('hide' => $hide), $navi['id']); $CACHE->updateCache('navi'); $isExists = true; break; } } if (!$isExists) { $DB->query("insert into " . DB_PREFIX . "navi (naviname,url,newtab,hide,taxis,isdefault) values('相册','?plugin=kl_album', 'n', '{$hide}', 4, 'y')"); $CACHE->updateCache('navi'); } }
<?php /** * 链接管理 * @copyright (c) Emlog All Rights Reserved */ require_once 'globals.php'; $Navi_Model = new Navi_Model(); if ($action == '') { $emPage = new Log_Model(); $navis = $Navi_Model->getNavis(); $sorts = $CACHE->readCache('sort'); $pages = $emPage->getAllPageList(); include View::getView('header'); require_once View::getView('navbar'); include View::getView('footer'); View::output(); } if ($action == 'taxis') { $navi = isset($_POST['navi']) ? $_POST['navi'] : ''; if (!empty($navi)) { foreach ($navi as $key => $value) { $value = intval($value); $key = intval($key); $Navi_Model->updateNavi(array('taxis' => $value), $key); } $CACHE->updateCache('navi'); emDirect("./navbar.php?active_taxis=1"); } else { emDirect("./navbar.php?error_b=1"); }