<?php
define('SCRIPTNAV', 'links');
require_once './include/inc_common.php';
!defined('IN_MUDDER') && exit('Access Denied');

if(!$MOD['open_apply']) {
    redirect('管理员关闭了友情链接的申请.');
}

if(check_submit('dosubmit')) {
    $applylink = array();
    $applylink['title'] = html_special_chars_ex($title);
    $applylink['link'] = html_special_chars_ex($link);
    $applylink['logo'] = html_special_chars_ex($logo);
    $applylink['des'] = html_special_chars_ex($des);

    if(!$applylink['title'] || !$applylink['link']) {
        redirect('表单未填写完整，请返回填写。');
    } else {
        $applylink['ischeck'] = 0;
        $db->insert_new($dbpre.'mylinks', $applylink);
        redirect('申请已提交，等待管理员审核。', $MOD['url']);
    }
}

$subtitle = '申请链接_友情链接';
require_once MUDDER_ROOT.'header.php';
require_once template(MOD_FLAG.'_apply');
footer();
?>