示例#1
0
文件: link.php 项目: flyysr/emlog
<?php

/**
 * 链接管理
 * @copyright (c) Emlog All Rights Reserved
 */
require_once 'globals.php';
$Link_Model = new Link_Model();
if ($action == '') {
    $links = $Link_Model->getLinks();
    include View::getView('header');
    require_once View::getView('links');
    include View::getView('footer');
    View::output();
}
if ($action == 'link_taxis') {
    $link = isset($_POST['link']) ? $_POST['link'] : '';
    if (!empty($link)) {
        foreach ($link as $key => $value) {
            $value = intval($value);
            $key = intval($key);
            $Link_Model->updateLink(array('taxis' => $value), $key);
        }
        $CACHE->updateCache('link');
        emDirect("./link.php?active_taxis=1");
    } else {
        emDirect("./link.php?error_b=1");
    }
}
if ($action == 'addlink') {
    $taxis = isset($_POST['taxis']) ? intval(trim($_POST['taxis'])) : 0;